Commit 8861f2cb authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] ppc64: Don't call scheduler on offline cpu

When taking a cpu offline, once the cpu has been removed from
cpu_online_map, it is not supposed to service any more interrupts.  This
presents a problem on ppc64 because we cannot truly disable the
decrementer.  There used to be cpu_is_offline() checks in several scheduler
functions (e.g.  rebalance_tick()) which papered over this issue, but these
checks were removed recently.  So with recent 2.6 kernels, an attempt to
offline a cpu can result in a crash in find_busiest_group().  This patch
prevents such crashes.
Signed-off-by: default avatarNathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7d2d3531
......@@ -48,6 +48,7 @@
#include <linux/time.h>
#include <linux/init.h>
#include <linux/profile.h>
#include <linux/cpu.h>
#include <asm/segment.h>
#include <asm/io.h>
......@@ -285,8 +286,20 @@ int timer_interrupt(struct pt_regs * regs)
while (lpaca->next_jiffy_update_tb <= (cur_tb = get_tb())) {
#ifdef CONFIG_SMP
smp_local_timer_interrupt(regs);
/*
* We cannot disable the decrementer, so in the period
* between this cpu's being marked offline in cpu_online_map
* and calling stop-self, it is taking timer interrupts.
* Avoid calling into the scheduler rebalancing code if this
* is the case.
*/
if (!cpu_is_offline(cpu))
smp_local_timer_interrupt(regs);
#endif
/*
* No need to check whether cpu is offline here; boot_cpuid
* should have been fixed up by now.
*/
if (cpu == boot_cpuid) {
write_seqlock(&xtime_lock);
tb_last_stamp = lpaca->next_jiffy_update_tb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment