From 2338d5c9914e2a43c3a4f7ee0f4355ad0a1ad9e7 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Sun, 28 Oct 2007 09:37:52 +0100 Subject: reduce wakeups from smart scheduler The smart scheduler itimer currently always fires after each request (which in turn causes the CPU to wake out of idle, burning precious power). Rather than doing this, just stop the timer before going into the select() portion of the WaitFor loop. It's a cheap system call, and it will only get called if there's no more commands batched up from the active fd. This change also allows some of the functions to be simplified; setitimer() will only fail if it's passed invalid data, and we don't do that... so make it void and remove all the conditional code that deals with failure. The change also allows us to remove a few variables that were used for housekeeping between the signal handler and the main loop. Signed-off-by: Keith Packard --- include/dixstruct.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/dixstruct.h') diff --git a/include/dixstruct.h b/include/dixstruct.h index dd6347f18..bed31dc2a 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -150,11 +150,9 @@ extern long SmartScheduleTime; extern long SmartScheduleInterval; extern long SmartScheduleSlice; extern long SmartScheduleMaxSlice; -extern unsigned long SmartScheduleIdleCount; extern Bool SmartScheduleDisable; -extern Bool SmartScheduleIdle; -extern Bool SmartScheduleTimerStopped; -extern Bool SmartScheduleStartTimer(void); +extern void SmartScheduleStartTimer(void); +extern void SmartScheduleStopTimer(void); #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) -- cgit v1.2.3