From 4347025be3ee2eaf0c12f7838df60ccaad126267 Mon Sep 17 00:00:00 2001 From: tegge Date: Sun, 17 May 1998 22:12:14 +0000 Subject: Add forwarding of roundrobin to other cpus. This gives a more regular update of cpu usage as shown by top when one process is cpu bound (no system calls) while the system is otherwise idle (except for top). Don't attempt to switch to the BSP in boot(). If the system was idle when an interrupt caused a panic, this won't work. Instead, switch to the BSP in cpu_reset. Remove some spurious forward_statclock/forward_hardclock warnings. --- sys/amd64/amd64/vm_machdep.c | 89 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) (limited to 'sys/amd64/amd64/vm_machdep.c') diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 78f16ae..7e3b32a 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.105 1998/03/23 19:52:42 jlemon Exp $ + * $Id: vm_machdep.c,v 1.106 1998/05/16 14:44:11 kato Exp $ */ #include "npx.h" @@ -87,6 +87,13 @@ #include #endif +static void cpu_reset_real __P((void)); +#ifdef SMP +static void cpu_reset_proxy __P((void)); +static u_int cpu_reset_proxyid; +static volatile u_int cpu_reset_proxy_active; +#endif + #ifdef BOUNCE_BUFFERS static vm_offset_t vm_bounce_kva __P((int size, int waitok)); @@ -838,9 +845,89 @@ vunmapbuf(bp) /* * Force reset the processor by invalidating the entire address space! */ + +#ifdef SMP +static void +cpu_reset_proxy() +{ + u_int saved_mp_lock; + + cpu_reset_proxy_active = 1; + while (cpu_reset_proxy_active == 1) + ; /* Wait for other cpu to disable interupts */ + saved_mp_lock = mp_lock; + mp_lock = 1; + printf("cpu_reset_proxy: Grabbed mp lock for BSP\n"); + cpu_reset_proxy_active = 3; + while (cpu_reset_proxy_active == 3) + ; /* Wait for other cpu to enable interrupts */ + stop_cpus((1<