Re: [PATCH] sched/core: Clear the root_domain cpumasks in init_rootdomain()

Peter Zijlstra
2015-12-03T09:35:34Z

On Thu, Dec 03, 2015 at 10:44:08AM +0800, Xunlei Pang wrote:

> > Nice, will you be looking for similar issues elsewhere in the scheduler
> > too?
>
> Sure :-)

Thanks!

> >>> in alloc_rootdomain() ?
> >> There is a "memset(rd, 0, sizeof(*rd))" in init_rootdomain(),
> >> so I don't think we need to do this in alloc_rootdomain().
> > Ah, right there is. Which also clears the mask for small systems.
>
> Yeah, maybe we can improve it using alloc_cpumask_var() with
> __GFP_ZERO instead of zalloc_cpumask_var() to avoid duplicate
> clean for small systems.

This isn't a performance critical path, so clarity and correctness are
more important than performance.