1 From dc2bba8f3fb50c82a0de823c03eb88f3c8c205d8 Mon Sep 17 00:00:00 2001
2 From: Yong Zhang <yong.zhang0@gmail.com>
3 Date: Thu, 28 Jul 2011 11:16:00 +0800
4 Subject: [PATCH 103/366] hotplug: Reread hotplug_pcp on pin_current_cpu()
7 When retry happens, it's likely that the task has been migrated to
8 another cpu (except unplug failed), but it still derefernces the
9 original hotplug_pcp per cpu data.
11 Update the pointer to hotplug_pcp in the retry path, so it points to
14 Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
15 Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
16 Link: http://lkml.kernel.org/r/20110728031600.GA338@windriver.com
17 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
20 1 file changed, 3 insertions(+), 1 deletion(-)
22 diff --git a/kernel/cpu.c b/kernel/cpu.c
23 index 218c7a1..04df252 100644
26 @@ -109,9 +109,11 @@ static DEFINE_PER_CPU(struct hotplug_pcp, hotplug_pcp);
28 void pin_current_cpu(void)
30 - struct hotplug_pcp *hp = this_cpu_ptr(&hotplug_pcp);
31 + struct hotplug_pcp *hp;
34 + hp = this_cpu_ptr(&hotplug_pcp);
36 if (!hp->unplug || hp->refcount || preempt_count() > 1 ||
37 hp->unplug == current) {