On 18/03/16 19:06, Dario Faggioli wrote: > like what's there already in both Credit1 and RTDS. In > fact, when playing with affinity, a lot of cpumask > manipulation is necessary, inside of various functions. > > To avoid having a lot of cpumask_var_t on the stack, > this patch introduces a global scratch area. > > Signed-off-by: Dario Faggioli <dario.faggi...@citrix.com> > --- > Cc: George Dunlap <george.dun...@eu.citrix.com> > ---
I would suggest instead going with static DEFINE_PER_CPU(cpumask_t, csched2_cpumask_scratch); Functions which want to use it can use cpumask_t *scratch = &this_cpu(csched2_cpumask_scratch); This avoids all this opencoded allocation/refcounting, the chance that starting a scheduler would fail for memory reasons, and one extra cpumask in the per-cpu data area won't break the bank. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel