Re: current linux-2.6.git: cpusets completely broken

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Sunday, July 13, 2008 - 10:46 am

On Sun, 13 Jul 2008, Linus Torvalds wrote:

IOW, I think we should totally remove the whole "update_sched_domains()" 
thing too. Any logic that needs it is broken. We shouldn't detach the 
scheduler domains in DOWN_PREPARE (much less UP_PREPARE), we should just 
leave them damn well alone.

As the comment says, "The domains and groups cannot be updated in place 
without racing with the balancing code". The thing is, we shouldn't even 
try. The correct way to handle all this is to make the balancing code use 
the domains regardless, but protect against CPU's going down with 
_another_ data structure that is much easier to update.

Namely something like 'cpu_active_map'.

Then we just get rid of all the crap in update_sched_domains() entirely, 
and then we can make the cpusets code do the *sane* thing, which is to 
rebuild the scheduler domains only when the CPU up/down has completed.

So instead of this illogical and crazy mess:

	+       switch (phase) {
	+       case CPU_UP_CANCELED:
	+       case CPU_UP_CANCELED_FROZEN:
	+       case CPU_DOWN_FAILED:
	+       case CPU_DOWN_FAILED_FROZEN:
	+       case CPU_ONLINE:
	+       case CPU_ONLINE_FROZEN:
	+       case CPU_DEAD:
	+       case CPU_DEAD_FROZEN:
	+               common_cpu_mem_hotplug_unplug(1);

it should just say

	+       switch (phase) {
	+       case CPU_ONLINE:
	+       case CPU_ONLINE_FROZEN:
	+       case CPU_DEAD:
	+       case CPU_DEAD_FROZEN:
	+               common_cpu_mem_hotplug_unplug(1);

because it only makes sense to rebuild the scheduler domains when the 
thing SUCCEEDS. 

See? By having a sane design, the code is not just more robust and easy to 
follow, you can also simplify it and make it more logical.

The current design is not sane.

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

Messages in current thread:
current linux-2.6.git: cpusets completely broken, Vegard Nossum, (Fri Jul 11, 12:07 pm)
Re: current linux-2.6.git: cpusets completely broken, Paul Menage, (Fri Jul 11, 12:36 pm)
Re: current linux-2.6.git: cpusets completely broken, Vegard Nossum, (Fri Jul 11, 12:43 pm)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Fri Jul 11, 1:07 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Fri Jul 11, 4:03 pm)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Fri Jul 11, 4:19 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Fri Jul 11, 4:53 pm)
Re: current linux-2.6.git: cpusets completely broken, Vegard Nossum, (Fri Jul 11, 8:17 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Fri Jul 11, 8:28 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Sat Jul 12, 3:04 am)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Sat Jul 12, 4:05 am)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sat Jul 12, 12:15 pm)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Sat Jul 12, 12:19 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sat Jul 12, 1:10 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sat Jul 12, 2:30 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sat Jul 12, 3:07 pm)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Sat Jul 12, 3:43 pm)
Re: current linux-2.6.git: cpusets completely broken, Vegard Nossum, (Sat Jul 12, 4:00 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sat Jul 12, 4:01 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sat Jul 12, 4:04 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Sat Jul 12, 4:05 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sat Jul 12, 4:17 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Sat Jul 12, 4:19 pm)
Re: current linux-2.6.git: cpusets completely broken, Vegard Nossum, (Sat Jul 12, 4:25 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Sat Jul 12, 4:25 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Sun Jul 13, 2:53 am)
Re: current linux-2.6.git: cpusets completely broken, Andi Kleen, (Sun Jul 13, 8:29 am)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sun Jul 13, 10:10 am)
Re: current linux-2.6.git: cpusets completely broken, Ingo Molnar, (Sun Jul 13, 10:42 am)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sun Jul 13, 10:46 am)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Sun Jul 13, 11:13 am)
Re: current linux-2.6.git: cpusets completely broken, Ingo Molnar, (Sun Jul 13, 11:19 am)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sun Jul 13, 11:20 am)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Sun Jul 13, 11:38 am)
Re: current linux-2.6.git: cpusets completely broken, Mike Travis, (Mon Jul 14, 8:49 am)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Mon Jul 14, 3:38 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Mon Jul 14, 4:05 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Mon Jul 14, 5:00 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Mon Jul 14, 5:23 pm)
Re: current linux-2.6.git: cpusets completely broken, Dmitry Adamushko, (Mon Jul 14, 7:21 pm)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Mon Jul 14, 8:03 pm)
Re: current linux-2.6.git: cpusets completely broken, Steven Rostedt, (Mon Jul 14, 8:23 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Mon Jul 14, 8:36 pm)
Re: current linux-2.6.git: cpusets completely broken, Steven Rostedt, (Mon Jul 14, 8:47 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Mon Jul 14, 9:04 pm)
Re: current linux-2.6.git: cpusets completely broken, Linus Torvalds, (Mon Jul 14, 9:12 pm)
Re: current linux-2.6.git: cpusets completely broken, Steven Rostedt, (Mon Jul 14, 9:16 pm)
Re: current linux-2.6.git: cpusets completely broken, Ingo Molnar, (Tue Jul 15, 1:32 am)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Tue Jul 15, 1:42 am)
Re: current linux-2.6.git: cpusets completely broken, Ingo Molnar, (Tue Jul 15, 1:57 am)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Tue Jul 15, 2:12 am)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Tue Jul 15, 11:35 pm)
Re: current linux-2.6.git: cpusets completely broken, Peter Zijlstra, (Wed Jul 16, 12:10 am)
Re: current linux-2.6.git: cpusets completely broken, Max Krasnyansky, (Wed Jul 16, 10:01 am)