diff options
author | 2012-07-10 16:56:28 +0000 | |
---|---|---|
committer | 2012-07-10 16:56:28 +0000 | |
commit | 87bf46853bf45b05d734e6ff97128c6f12ba94e6 (patch) | |
tree | 9a4862050a52849ce4fefc0180a1d631ef6d18e8 | |
parent | Add a subtest to the MTU ping that checks wether the ip length of (diff) | |
download | wireguard-openbsd-87bf46853bf45b05d734e6ff97128c6f12ba94e6.tar.xz wireguard-openbsd-87bf46853bf45b05d734e6ff97128c6f12ba94e6.zip |
We should only call need_resched() if the priority is lower than the
priority of the current running process.
In amd64 a call to need_resched() sends an IPI to the other cpu.
This fixes aja@ problem where he would move the mouse and see 60000
IPIs being sent.
Thanks to mikeb@ for bringing that subject up tuesday.
Actually found this after inquiring guenther@ about some changes in
mi_switch().
ok guenther@ aja@
-rw-r--r-- | sys/kern/kern_synch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index caa939353e7..c885f83aa36 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.102 2012/04/10 11:33:58 guenther Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.103 2012/07/10 16:56:28 haesbaert Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -378,7 +378,9 @@ wakeup_n(const volatile void *ident, int n) p->p_stat = SRUN; p->p_cpu = sched_choosecpu(p); setrunqueue(p); - need_resched(p->p_cpu); + if (p->p_priority < + p->p_cpu->ci_schedstate.spc_curpriority) + need_resched(p->p_cpu); /* END INLINE EXPANSION */ } |