From c97ad5cdc75eb73e3cc38542ca3ba783574b0a7a Mon Sep 17 00:00:00 2001 From: akolb Date: Fri, 9 Mar 2007 15:55:28 -0800 Subject: PSARC/2004/402 CPU Caps 6327235 PSARC/2004/402 CPU caps 6464161 Dead KSLICE code should be removed 6514387 FX class contains dead code to keep list of member threads 6518395 kstat_zone_add performs KM_SLEEP allocation when it should not --- usr/src/uts/common/os/clock.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'usr/src/uts/common/os/clock.c') diff --git a/usr/src/uts/common/os/clock.c b/usr/src/uts/common/os/clock.c index 0a8a99f0af..06babeb55c 100644 --- a/usr/src/uts/common/os/clock.c +++ b/usr/src/uts/common/os/clock.c @@ -79,8 +79,7 @@ #include /* - * clock is called straight from - * the real time clock interrupt. + * clock() is called straight from the clock cyclic; see clock_init(). * * Functions: * reprime clock @@ -314,10 +313,7 @@ static int genloadavg(struct loadavg_s *); static void loadavg_update(); void (*cmm_clock_callout)() = NULL; - -#ifdef KSLICE -int kslice = KSLICE; -#endif +void (*cpucaps_clock_callout)() = NULL; static void clock(void) @@ -513,9 +509,10 @@ clock(void) /* * Do tick processing for all the active threads running in - * the system. + * the system. We're trying to be more fair by walking the + * list of CPUs starting from a different CPUs each time. */ - cp = cpu_list; + cp = clock_cpu_list; nrunning = 0; do { klwp_id_t lwp; @@ -649,21 +646,11 @@ clock(void) clock_tick(t); } -#ifdef KSLICE - /* - * Ah what the heck, give this kid a taste of the real - * world and yank the rug out from under it. - * But, only if we are running UniProcessor. - */ - if ((kslice) && (ncpus == 1)) { - aston(t); - cp->cpu_runrun = 1; - cp->cpu_kprunrun = 1; - } -#endif if (!exiting) mutex_exit(plockp); - } while ((cp = cp->cpu_next) != cpu_list); + } while ((cp = cp->cpu_next) != clock_cpu_list); + + clock_cpu_list = clock_cpu_list->cpu_next; /* * bump time in ticks @@ -683,6 +670,9 @@ clock(void) if ((funcp = cmm_clock_callout) != NULL) (*funcp)(); + if ((funcp = cpucaps_clock_callout) != NULL) + (*funcp)(); + /* * Wakeup the cageout thread waiters once per second. */ -- cgit v1.2.3