Messages in this thread | | | Date | Tue, 15 Oct 2013 11:18:51 -0400 | From | Tejun Heo <> | Subject | Re: [PATCH v2 03/12] cpuset: update cs->effective_{cpus,mems} when config changes |
| |
On Fri, Oct 11, 2013 at 05:50:04PM +0800, Li Zefan wrote: > + cpuset_for_each_descendant_pre(cp, pos_css, cs) { > + struct cpuset *parent = parent_cs(cp); > + struct cpumask *new_cpus = trialcs->effective_cpus; > + > + cpumask_and(new_cpus, cp->cpus_allowed, > + parent->effective_cpus);
So, @trial_cs is only passed in to use its ->effective_cpus as temporary buffer? If allocating from inside the function isn't an option, wouldn't it be better to pass in cpumask * instead of the whole trial_cs and explicitly note that the argument is used as a temp var?
... > + cpuset_for_each_descendant_pre(cp, pos_css, cs) { > + struct cpuset *parent = parent_cs(cp); > + nodemask_t *new_mems = &trialcs->effective_mems; > + > + nodes_and(*new_mems, cp->mems_allowed, > + parent->effective_mems);
Ditto.
Thanks.
-- tejun
| |