diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-20 22:05:15 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-20 22:05:15 +0000 |
commit | 367cacb998f164b1cca5132cccaf6d674594d000 (patch) | |
tree | b698b1c472961963d279880a57d97f69dfbf7135 /sys/kern | |
parent | 12ea671b20c8f2b724519d518d2c4f8881e8cf58 (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.c | 7 |
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) { |