lkml.org 
[lkml]   [2013]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH cpuset] Use rebuild_sched_domains() in cpuset_hotplug_workfn()
On 2013/4/2 15:16, Li Zhong wrote:
> In cpuset_hotplug_workfn(), partition_sched_domains() is called without
> hotplug lock held, which is actually needed (stated in the function
> header of partition_sched_domains()).
>
> This patch tries to use rebuild_sched_domains() to solve the above
> issue, and makes the code looks a little simpler.
>

I guess you found this just by code inspection, right?

The change looks fine and safe at a first glance, but we don't have
time to review the patch for now.

However I don't know why partition_sched_domains() has to be called
with hotplug lock held.

After a quick scan, seems the only place in partition_sched_domains()
that might need hotplug lock is arch_update_cpu_topology().

It would be better if you had CCed the scheduler guys...They may
know the answer.

> Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
> ---
> kernel/cpuset.c | 13 ++-----------
> 1 files changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> index 4f9dfe4..515a713 100644
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -2222,17 +2222,8 @@ static void cpuset_hotplug_workfn(struct work_struct *work)
> flush_workqueue(cpuset_propagate_hotplug_wq);
>
> /* rebuild sched domains if cpus_allowed has changed */
> - if (cpus_updated) {
> - struct sched_domain_attr *attr;
> - cpumask_var_t *doms;
> - int ndoms;
> -
> - mutex_lock(&cpuset_mutex);
> - ndoms = generate_sched_domains(&doms, &attr);
> - mutex_unlock(&cpuset_mutex);
> -
> - partition_sched_domains(ndoms, doms, attr);
> - }
> + if (cpus_updated)
> + rebuild_sched_domains();
> }
>




\
 
 \ /
  Last update: 2013-04-03 12:21    [W:0.057 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site