rcupreempt: fix hibernate/resume in presence of PREEMPT_RCU and hotplug

This fixes a oops encountered when doing hibernate/resume in presence of
PREEMPT_RCU.

The problem was that the code failed to disable preemption when
accessing a per-CPU variable.  This is OK when called from code that
already has preemption disabled, but such is not the case from the
suspend/resume code path.

Reported-by: Dave Young <hidave.darkstar@gmail.com>
Tested-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Paul E. McKenney 2008-02-27 16:21:10 -08:00 committed by Ingo Molnar
parent 076d84bbdb
commit ae778869ae
1 changed files with 2 additions and 1 deletions

View File

@ -918,8 +918,9 @@ void rcu_offline_cpu(int cpu)
* fix. * fix.
*/ */
local_irq_save(flags);
rdp = RCU_DATA_ME(); rdp = RCU_DATA_ME();
spin_lock_irqsave(&rdp->lock, flags); spin_lock(&rdp->lock);
*rdp->nexttail = list; *rdp->nexttail = list;
if (list) if (list)
rdp->nexttail = tail; rdp->nexttail = tail;