Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Srivatsa Vaddagiri <vatsa@...>
Cc: Gautham R Shenoy <ego@...>, <akpm@...>, <paulmck@...>, <torvalds@...>, <linux-kernel@...>, Oleg Nesterov <oleg@...>, Rafael J. Wysocki <rjw@...>, <dipankar@...>, <dino@...>, <masami.hiramatsu.pt@...>
Date: Monday, April 2, 2007 - 2:56 pm

* Srivatsa Vaddagiri <vatsa@in.ibm.com> wrote:


ok. But the only real problem would be for_each_online_cpu() loops that 
might sleep, correct? I did a quick audit and those seem to be in the 
minority by a factor of 1:10.

So ... to make the audit obviously safe, how about mechanically 
converting 100% of the for_each_online_cpu() loops to something like:

	mask = get_each_online_cpu_mask();
	for_each_cpu_mask(mask) {
		...
	}
	put_each_online_cpu_mask(mask);

where get_each_online_cpu_mask() also does a preempt_disable() 
implicitly, and put_each_online_cpu_mask() does a preempt_enable(). 
(Note that no locking is needed - only preemption-disabling.)

the 10% loops that _can_ schedule would trigger the __might_sleep() 
atomicity test in schedule()), and those would have to be converted a 
bit more cleverly, on a case by case basis. (for example a number of 
them might not even have to sleep on the for_each_online_cpu() loop)

hm?

	Ingo
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] Cpu-hotplug: Using the Process Freezer (try2), Gautham R Shenoy, (Mon Apr 2, 1:34 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Gautham R Shenoy, (Tue Apr 3, 8:01 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Rafael J. Wysocki, (Tue Apr 3, 3:34 pm)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Andrew Morton, (Tue Apr 3, 4:24 pm)
Re: utrace merge, Ingo Molnar, (Wed Apr 4, 6:06 am)
Re: utrace merge, Christoph Hellwig, (Wed Apr 4, 6:36 am)
Re: utrace merge, Andrew Morton, (Wed Apr 4, 2:41 pm)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Gautham R Shenoy, (Tue Apr 3, 10:01 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Gautham R Shenoy, (Mon Apr 2, 7:19 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Rafael J. Wysocki, (Mon Apr 2, 6:12 pm)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Srivatsa Vaddagiri, (Mon Apr 2, 5:28 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Srivatsa Vaddagiri, (Mon Apr 2, 8:42 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Ingo Molnar, (Mon Apr 2, 2:56 pm)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Srivatsa Vaddagiri, (Tue Apr 3, 8:56 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Gautham R Shenoy, (Tue Apr 3, 10:15 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Srivatsa Vaddagiri, (Tue Apr 3, 11:15 pm)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Gautham R Shenoy, (Wed Apr 4, 6:41 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Gautham R Shenoy, (Wed Apr 4, 8:24 am)
Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2), Gautham R Shenoy, (Mon Apr 2, 10:16 am)
[PATCH 8/8] Make kernel threads freezeable for cpu-hotplug, Gautham R Shenoy, (Mon Apr 2, 1:42 am)
Re: [PATCH 7/8] Clean up workqueue.c with respect to the fre..., Srivatsa Vaddagiri, (Tue Apr 3, 9:59 am)
Re: [PATCH 7/8] Clean up workqueue.c with respect to the fre..., Srivatsa Vaddagiri, (Tue Apr 3, 1:18 pm)
Re: [PATCH 7/8] Clean up workqueue.c with respect to the fre..., Srivatsa Vaddagiri, (Wed Apr 11, 10:22 pm)
Re: [PATCH 7/8] Clean up workqueue.c with respect to the fre..., Srivatsa Vaddagiri, (Wed Apr 4, 1:49 pm)
[PATCH 5/8] __cpu_up: use singlethreaded workqueue, Gautham R Shenoy, (Mon Apr 2, 1:40 am)
Re: [PATCH 5/8] __cpu_up: use singlethreaded workqueue, Oleg Nesterov, (Thu Apr 5, 8:08 am)
[PATCH 4/8] Rip out lock_cpu_hotplug(), Gautham R Shenoy, (Mon Apr 2, 1:39 am)
[PATCH 3/8] Use process freezer for cpu-hotplug, Gautham R Shenoy, (Mon Apr 2, 1:38 am)
Re: [PATCH 3/8] Use process freezer for cpu-hotplug, Nathan Lynch, (Fri Apr 6, 1:27 pm)
Re: [PATCH 3/8] Use process freezer for cpu-hotplug, Ingo Molnar, (Fri Apr 6, 1:34 pm)
Re: [PATCH 3/8] Use process freezer for cpu-hotplug, Pavel Machek, (Sat Apr 14, 2:48 pm)
Re: [PATCH 3/8] Use process freezer for cpu-hotplug, Nathan Lynch, (Fri Apr 6, 1:47 pm)
Re: [PATCH 3/8] Use process freezer for cpu-hotplug, Nigel Cunningham, (Fri Apr 6, 6:22 pm)
Re: [PATCH 3/8] Use process freezer for cpu-hotplug, Oleg Nesterov, (Thu Apr 5, 6:53 am)
Re: [PATCH 3/8] Use process freezer for cpu-hotplug, Gautham R Shenoy, (Thu Apr 5, 8:14 am)
Re: [PATCH 3/8] Use process freezer for cpu-hotplug, Oleg Nesterov, (Thu Apr 5, 9:34 am)
[PATCH 2/8] Make process freezer reentrant, Gautham R Shenoy, (Mon Apr 2, 1:37 am)
Re: [PATCH 2/8] Make process freezer reentrant, Oleg Nesterov, (Thu Apr 5, 5:53 am)
Re: [PATCH 2/8] Make process freezer reentrant, Gautham R Shenoy, (Thu Apr 5, 6:19 am)
Re: [PATCH 1/8] Enhance process freezer interface for usage ..., Rafael J. Wysocki, (Fri Apr 6, 10:34 am)