Re: [PATCH v2.1 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-27 Thread Benjamin Herrenschmidt
On Sun, 2012-03-25 at 19:42 +0200, Oleg Nesterov wrote: > > Also, Per Peter Zijlstra's idea, now we don't grab tasklist_lock in > > the new helper, instead we take the rcu read lock. We can do this > > because the function is called after the cpu is taken down and > marked > > offline, so no new ta

Re: [PATCH v2.1 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-26 Thread Peter Zijlstra
On Mon, 2012-03-26 at 19:04 +0200, Oleg Nesterov wrote: > Interesting... Why? I mean, why do you dislike stop_machine() in > _cpu_down() ? Just curious. It disturbs all cpus, the -rt people don't like that their FIFO tasks don't get to run, the trading people don't like their RDMA poll loops to b

Re: [PATCH v2.1 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-26 Thread Oleg Nesterov
On 03/26, Peter Zijlstra wrote: > > On Sun, 2012-03-25 at 19:42 +0200, Oleg Nesterov wrote: > > __cpu_disable() is called by __stop_machine(), we know that nobody > > can preempt us and other CPUs can do nothing. > > It would be very good to not rely on that though, Yes, yes, perhaps I wasn't clea

Re: [PATCH v2.1 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-26 Thread Peter Zijlstra
On Sun, 2012-03-25 at 19:42 +0200, Oleg Nesterov wrote: > __cpu_disable() is called by __stop_machine(), we know that nobody > can preempt us and other CPUs can do nothing. It would be very good to not rely on that though, I would love to get rid of the stop_machine usage in cpu hotplug some day.

Re: [PATCH v2.1 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-25 Thread Oleg Nesterov
On 03/24, Anton Vorontsov wrote: > > Many architctures clear tasks' mm_cpumask like this: > > read_lock(&tasklist_lock); > for_each_process(p) { > if (p->mm) > cpumask_clear_cpu(cpu, mm_cpumask(p->mm)); > } > read_unlock(&tasklist_lock);

[PATCH v2.1 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-24 Thread Anton Vorontsov
Many architctures clear tasks' mm_cpumask like this: read_lock(&tasklist_lock); for_each_process(p) { if (p->mm) cpumask_clear_cpu(cpu, mm_cpumask(p->mm)); } read_unlock(&tasklist_lock); The code above has several problems, s