Add a macro that clears the want_resched flag that need_resched sets.
authorart <art@openbsd.org>
Fri, 18 Jul 2008 23:43:31 +0000 (23:43 +0000)
committerart <art@openbsd.org>
Fri, 18 Jul 2008 23:43:31 +0000 (23:43 +0000)
commit2c9d4ccbcf9b120efddf613d0ef0d6e5a35509ec
tree804a1919b1859d64d3ce0d66bf3e17b153623f2e
parent0e20dd820a204fc79b499d2cbd2f6a56af301e99
Add a macro that clears the want_resched flag that need_resched sets.
Right now when mi_switch picks up the same proc, we didn't clear the
flag which would mean that every time we service an AST we would attempt
a context switch. For some architectures, amd64 being probably the
most extreme, that meant attempting to context switch for every
trap and interrupt.

Now we clear_resched explicitly after every context switch, even if it
didn't do anything. Which also allows us to remove some more code
in cpu_switchto (not done yet).

miod@ ok
17 files changed:
sys/arch/alpha/include/cpu.h
sys/arch/amd64/include/cpu.h
sys/arch/arm/include/cpu.h
sys/arch/hp300/include/cpu.h
sys/arch/hppa/include/cpu.h
sys/arch/hppa64/include/cpu.h
sys/arch/i386/include/cpu.h
sys/arch/m88k/include/cpu.h
sys/arch/mac68k/include/cpu.h
sys/arch/mips64/include/cpu.h
sys/arch/mvme68k/include/cpu.h
sys/arch/powerpc/include/cpu.h
sys/arch/sh/include/cpu.h
sys/arch/sparc/include/cpu.h
sys/arch/sparc64/include/cpu.h
sys/arch/vax/include/cpu.h
sys/kern/sched_bsd.c