[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080701061600.GF14658@elte.hu>
Date: Tue, 1 Jul 2008 08:16:01 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Gautham R Shenoy <ego@...ibm.com>
Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Dhaval Giani <dhaval@...ux.vnet.ibm.com>,
Dipankar Sarma <dipankar@...ibm.com>, laijs@...fujitsu.com,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
lkml <linux-kernel@...r.kernel.org>,
Rusty Russel <rusty@...tcorp.com.au>
Subject: Re: [PATCH] fix rcu vs hotplug race
* Gautham R Shenoy <ego@...ibm.com> wrote:
> So, it's the design of stop_machine() that's preventing someone from
> updating the cpu_online_map while force_quiescent_state() is
> performing the cpu_is_online() check. Becase we always call
> force_quiescent_state() with irqs disabled :)
Paul, do you concur? I'll apply the commit in the form below to
tip/core/urgent if Paul agrees.
Ingo
----------------------------------->
Subject: cpu-hotplug + rcu: fix spurious warning
From: Dhaval Giani <dhaval@...ux.vnet.ibm.com>
Date: Mon, 23 Jun 2008 16:07:00 +0530
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.
It's the design of stop_machine() that's preventing someone from
updating the cpu_online_map while force_quiescent_state() is
performing the cpu_is_online() check. Becase we always call
force_quiescent_state() with irqs disabled :)
Signed-off-by: Dhaval Giani <dhaval@...ux.vnet.ibm.com>
Acked-by: Gautham R Shenoy <ego@...ibm.com>
Cc: paulmck@...ux.vnet.ibm.com
Cc: Dipankar Sarma <dipankar@...ibm.com>
Cc: laijs@...fujitsu.com
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/rcuclassic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: tip/kernel/rcuclassic.c
===================================================================
--- tip.orig/kernel/rcuclassic.c
+++ tip/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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists