Re: [PATCH] cpumask: alloc blank cpumask left over

Rusty Russell
2009-06-06T23:43:50Z

On Sat, 6 Jun 2009 03:04:35 am Linus Torvalds wrote:
> On Fri, 5 Jun 2009, Rusty Russell wrote:
> > OK, here's what I've got in my tree. Ingo, I think this should go in the
> > current -rc to avoid nasty bugs.
>
> Why is the fix not to simply clear it in alloc?

Sure.

> and that
> FIXME is bogus. The end of the allocation needs to be cleared regardless.

Under these new semantics, yep. Before:
alloc_cpumask_var(&mask, GFP_KERNEL);
// New operator only goes to nr_cpu_ids bits.
cpumask_clear(mask);
// Old operator uses all NR_CPUS bits.
BUG_ON(cpus_weight(*mask) != 0);

Thanks,
Rusty.