public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix rcu vs hotplug race
@ 2008-06-23 10:37 Dhaval Giani
  2008-06-23 10:58 ` Ingo Molnar
  0 siblings, 1 reply; 18+ messages in thread
From: Dhaval Giani @ 2008-06-23 10:37 UTC (permalink / raw)
  To: paulmck, Dipankar Sarma, Gautham Shenoy, laijs, Ingo Molnar,
	Peter Zijlstra
  Cc: lkml

On running kernel compiles in parallel with cpu hotplug,

------------[ cut here ]------------
WARNING: at arch/x86/kernel/smp.c:118
native_smp_send_reschedule+0x21/0x36()
Modules linked in:
Pid: 27483, comm: cc1 Not tainted 2.6.26-rc7 #1
 [<c01217d9>] warn_on_slowpath+0x41/0x5d
 [<c01515b7>] ? generic_file_aio_read+0x10f/0x137
 [<c0151340>] ? file_read_actor+0x0/0xf7
 [<c013ae4c>] ? validate_chain+0xaa/0x29c
 [<c013c854>] ? __lock_acquire+0x612/0x666
 [<c013c854>] ? __lock_acquire+0x612/0x666
 [<c013ae4c>] ? validate_chain+0xaa/0x29c
 [<c01715d3>] ? file_kill+0x2d/0x30
 [<c013cbd7>] ? __lock_release+0x4b/0x51
 [<c01715d3>] ? file_kill+0x2d/0x30
 [<c0110355>] native_smp_send_reschedule+0x21/0x36
 [<c014fe8f>] force_quiescent_state+0x47/0x57
 [<c014fef0>] call_rcu+0x51/0x6d
 [<c01713b3>] __fput+0x130/0x158
 [<c0171231>] fput+0x17/0x19
 [<c016fd99>] filp_close+0x4d/0x57
 [<c016fdff>] sys_close+0x5c/0x97
 [<c0103861>] sysenter_past_esp+0x6a/0xb1
 =======================
---[ end trace aa35f3913ddf2d06 ]---

This is because a reschedule is sent to a CPU which is offline.
Just ensure that the CPU we send the smp_send_reschedule is actually
online.

Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
---
 kernel/rcuclassic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.26-rc7/kernel/rcuclassic.c
===================================================================
--- linux-2.6.26-rc7.orig/kernel/rcuclassic.c
+++ linux-2.6.26-rc7/kernel/rcuclassic.c
@@ -93,7 +93,8 @@ static void force_quiescent_state(struct
 		cpumask = rcp->cpumask;
 		cpu_clear(rdp->cpu, cpumask);
 		for_each_cpu_mask(cpu, cpumask)
-			smp_send_reschedule(cpu);
+			if (cpu_online(cpu))
+				smp_send_reschedule(cpu);
 	}
 }
 #else
-- 
regards,
Dhaval

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2008-08-01 21:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-23 10:37 [PATCH] fix rcu vs hotplug race Dhaval Giani
2008-06-23 10:58 ` Ingo Molnar
2008-06-23 11:49   ` Gautham R Shenoy
2008-06-24 11:01     ` Ingo Molnar
2008-06-26 15:27       ` Paul E. McKenney
2008-06-27  4:47         ` Gautham R Shenoy
2008-06-27  5:18           ` Dipankar Sarma
2008-06-27  5:49             ` Dhaval Giani
2008-06-27 14:58               ` Paul E. McKenney
2008-07-01  5:39                 ` Gautham R Shenoy
2008-07-01  6:16                   ` Ingo Molnar
2008-07-01  6:28                     ` Dhaval Giani
2008-07-01  6:35                       ` Ingo Molnar
2008-07-01  6:52                         ` Ingo Molnar
2008-07-01  7:48                           ` Ingo Molnar
2008-07-01  8:32                             ` Ingo Molnar
2008-07-01 19:46                   ` Paul E. McKenney
2008-08-01 21:01                   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox