diff options
author | Keith Packard <keithp@keithp.com> | 2015-11-11 22:02:01 -0800 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-12-01 13:54:54 -0500 |
commit | e10ba9e4b52269b2ac75c4802dce4ca47d169657 (patch) | |
tree | 653de4bab7b3ca2b2b1fd41aaaf35af81e78c69f /dix | |
parent | c7f4aef8f45e500c900d59f68c653477148907ea (diff) |
Remove non-smart scheduler. Don't require setitimer.
This allows the server to call GetTimeInMillis() after each request is
processed to avoid needing setitimer. -dumbSched now turns off the
setitimer.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/dispatch.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index 2c201245a..53032dc64 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -222,11 +222,11 @@ UpdateCurrentTimeIf(void) #define SMART_SCHEDULE_DEFAULT_INTERVAL 5 #define SMART_SCHEDULE_MAX_SLICE 15 -#if defined(WIN32) && !defined(__CYGWIN__) -Bool SmartScheduleDisable = TRUE; -#else -Bool SmartScheduleDisable = FALSE; +#ifdef HAVE_SETITIMER +#define SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE HAVE_SETITIMER +Bool SmartScheduleSignalEnable = SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE; #endif + long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; @@ -358,7 +358,7 @@ Dispatch(void) nready = WaitForSomething(clientReady); - if (nready && !SmartScheduleDisable) { + if (nready) { clientReady[0] = SmartScheduleClient(clientReady, nready); nready = 1; } @@ -386,8 +386,8 @@ Dispatch(void) ProcessInputEvents(); FlushIfCriticalOutputPending(); - if (!SmartScheduleDisable && - (SmartScheduleTime - start_tick) >= SmartScheduleSlice) { + if ((SmartScheduleTime - start_tick) >= SmartScheduleSlice) + { /* Penalize clients which consume ticks */ if (client->smart_priority > SMART_MIN_PRIORITY) client->smart_priority--; @@ -431,6 +431,9 @@ Dispatch(void) (*client->requestVector[client->majorOp]) (client); XaceHookAuditEnd(client, result); } + if (!SmartScheduleSignalEnable) + SmartScheduleTime = GetTimeInMillis(); + #ifdef XSERVER_DTRACE if (XSERVER_REQUEST_DONE_ENABLED()) XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), |