From cbf40e0f6a4ee8fde77e05f8b74ca4b989937d38 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Fri, 18 Jul 2008 23:43:32 +0000 Subject: 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 --- sys/arch/amd64/include/cpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/arch/amd64/include') diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index 2516fdd256b..248a9659c6e 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.36 2008/06/10 02:55:39 weingart Exp $ */ +/* $OpenBSD: cpu.h,v 1.37 2008/07/18 23:43:31 art Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -161,6 +161,7 @@ extern struct cpu_info *cpu_info_list; * or after the current trap/syscall if in system mode. */ extern void need_resched(struct cpu_info *); +#define clear_resched(ci) (ci)->ci_want_resched = 0 #if defined(MULTIPROCESSOR) -- cgit v1.2.3