lkml.org 
[lkml]   [2008]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH 2/3] stop_machine: simplify
Date
On Tuesday 08 July 2008 21:44:40 Akinobu Mita wrote:
> I found a small possible cleanup in this patch.

Well spotted! I think this cleanup is actually orthogonal to my patch,
so best served as a separate patch, how's this?

===
Hotplug CPU: don't check cpu_online after take_cpu_down

Akinobu points out that if take_cpu_down() succeeds, the cpu must be offline
(otherwise we're in deep trouble anyway.

Remove the cpu_online() check, and put a BUG_ON().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Akinobu Mita" <akinobu.mita@gmail.com>

diff -r 805a2e5e68dd kernel/cpu.c
--- a/kernel/cpu.c Tue Jul 08 23:04:48 2008 +1000
+++ b/kernel/cpu.c Tue Jul 08 23:07:43 2008 +1000
@@ -226,8 +226,7 @@ static int __ref _cpu_down(unsigned int
set_cpus_allowed_ptr(current, &tmp);

err = __stop_machine_run(take_cpu_down, &tcd_param, cpu);
-
- if (err || cpu_online(cpu)) {
+ if (err) {
/* CPU didn't die: tell everyone. Can't complain. */
if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED | mod,
hcpu) == NOTIFY_BAD)
@@ -235,6 +234,7 @@ static int __ref _cpu_down(unsigned int

goto out_allowed;
}
+ BUG_ON(cpu_online(cpu));

/* Wait for it to sleep (leaving idle task). */
while (!idle_cpu(cpu))

\
 
 \ /
  Last update: 2008-07-08 15:15    [W:0.218 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site