From 3742bd96fed95ec6268899cc2a0174b7b56bdfd9 Mon Sep 17 00:00:00 2001 From: Attilio Rao Date: Thu, 12 Aug 2010 13:46:43 +0000 Subject: [PATCH] Revert r211176: As long as interrupts are disabled and there is not explicit call to sched_add() there can't be any preemption there, thus the calls may be consistent. Reported by: kib, jhb --- sys/amd64/amd64/mp_machdep.c | 10 +--------- sys/i386/i386/mp_machdep.c | 8 +------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 3646ef0fe3d..7ea4d7d79fe 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -1324,10 +1324,8 @@ cpustop_handler(void) cpumask_t cpumask; u_int cpu; - sched_pin(); cpu = PCPU_GET(cpuid); cpumask = PCPU_GET(cpumask); - sched_unpin(); savectx(&stoppcbs[cpu]); @@ -1358,10 +1356,8 @@ cpususpend_handler(void) register_t cr3, rf; u_int cpu; - sched_pin(); cpu = PCPU_GET(cpuid); cpumask = PCPU_GET(cpumask); - sched_unpin(); rf = intr_disable(); cr3 = rcr3(); @@ -1542,14 +1538,10 @@ mp_grab_cpu_hlt(void) #endif int retval; + mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG - sched_pin(); - mask = PCPU_GET(cpumask); cpuid = PCPU_GET(cpuid); - sched_unpin(); ap_watchdog(cpuid); -#else - mask = PCPU_GET(cpumask); #endif retval = 0; diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 1a89b701d15..ddbb6318cb8 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -1411,10 +1411,8 @@ cpustop_handler(void) cpumask_t cpumask; u_int cpu; - sched_pin(); cpu = PCPU_GET(cpuid); cpumask = PCPU_GET(cpumask); - sched_unpin(); savectx(&stoppcbs[cpu]); @@ -1588,14 +1586,10 @@ mp_grab_cpu_hlt(void) #endif int retval; + mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG - sched_pin(); - mask = PCPU_GET(cpumask); cpuid = PCPU_GET(cpuid); - sched_unpin(); ap_watchdog(cpuid); -#else - mask = PCPU_GET(cpumask); #endif retval = 0;