[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 09 of 11] libxl, xl: enable automatic placement of guests on NUMA nodes
On Thu, 2012-05-31 at 17:27 +0100, Dario Faggioli wrote: > On Thu, 2012-05-31 at 16:02 +0100, Ian Jackson wrote: > > Dario Faggioli writes ("[PATCH 09 of 11] libxl, xl: enable automatic > > placement of guests on NUMA nodes"): > > > If a domain does not have a VCPU affinity, try to pin it automatically > > > to some PCPUs. This is done taking into account the NUMA characteristics > > > of the host: we look for a combination of host's NUMA nodes that has > > > enough > > > free memoy for the new domain, and pin it to the VCPUs of those nodes. > > > Smaller combinations are considered first, to avoid spreading the > > > domain's memory among too many nodes. > > > > Thanks for this. Here are my comments: > > > Thanks to you. :-) > > > > +static void libxl_nodemap_rand_init(libxl_nodemap *nodemap) > > > +{ > > > + int i; > > > + nodemap->size = rand() % 16; > > > + nodemap->map = calloc(nodemap->size, sizeof(*nodemap->map)); > > > + libxl_for_each_node(i, *nodemap) { > > > + if (rand() % 2) > > > + libxl_nodemap_set(nodemap, i); > > > + else > > > + libxl_nodemap_reset(nodemap, i); > > > + } > > > +} > > > > For your random number generation, please use nrand48, with a seed in > > the libxl ctx. (This means you'll need to take out the ctx lock.) > > And provide a way to set the seed. > > > Sounds reasonable, I'll look into this. As a side note, as I > deliberately took inspiration from libxl_cpumap_rand_init() for this, > should I apply what you just said to that function too? This code is in gentest.py not libxl proper, it doesn't need a seed in the ctx nor to use good random numbers, Ian J was mistakenly think this was actual libxl functionality I think. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |