summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-09-20 22:05:15 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-09-20 22:05:15 +0000
commit367cacb998f164b1cca5132cccaf6d674594d000 (patch)
treeb698b1c472961963d279880a57d97f69dfbf7135 /sys/kern
parent12ea671b20c8f2b724519d518d2c4f8881e8cf58 (diff)
Short circuit if we're running on the CPU that we want to sync with. Fixes
suspend on machines with em(4) now that it uses intr_barrier(9). ok krw@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sched.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c
index 089e9bf7e67..a1fa25a54eb 100644
--- a/sys/kern/kern_sched.c
+++ b/sys/kern/kern_sched.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sched.c,v 1.37 2015/09/13 11:15:11 kettenis Exp $ */
+/* $OpenBSD: kern_sched.c,v 1.38 2015/09/20 22:05:14 kettenis Exp $ */
/*
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
*
@@ -661,9 +661,12 @@ sched_barrier(struct cpu_info *ci)
}
}
KASSERT(ci != NULL);
- spc = &ci->ci_schedstate;
+
+ if (ci == curcpu())
+ return;
task_set(&task, sched_barrier_task, ci);
+ spc = &ci->ci_schedstate;
spc->spc_barrier = 0;
task_add(systq, &task);
while (!spc->spc_barrier) {