summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2009-04-22 08:35:55 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2009-04-22 08:35:55 +0000
commit4a5083a2aa15ee1e8d3f57df7a35ef1eca35749b (patch)
tree02ba42f23c1c13cd4e6f04e90a2db56a1da609da /sys
parent497f49be7c15e8cdd0ffefc2f79ac0ebbbc2f451 (diff)
When starting up idle, explicitly set p_cpu and the peg flag for the
idle proc. p_cpu might be necessary in the future and pegging is just to be extra safe (although we'll be horribly broken if the idle proc ever ends up where that flag is checked).
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_sched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c
index f7b58cd0b43..08694052d08 100644
--- a/sys/kern/kern_sched.c
+++ b/sys/kern/kern_sched.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sched.c,v 1.12 2009/04/20 08:48:17 art Exp $ */
+/* $OpenBSD: kern_sched.c,v 1.13 2009/04/22 08:35:54 art Exp $ */
/*
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
*
@@ -120,6 +120,8 @@ sched_idle(void *v)
SCHED_LOCK(s);
cpuset_add(&sched_idle_cpus, ci);
p->p_stat = SSLEEP;
+ p->p_cpu = ci;
+ atomic_setbits_int(&p->p_flag, P_CPUPEG);
mi_switch();
cpuset_del(&sched_idle_cpus, ci);
SCHED_UNLOCK(s);