From 6884e6a5b0cabdce39005470f4bcd0d960cfc956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20B=C3=A9rard?= Date: Thu, 9 Feb 2017 14:05:32 +0100 Subject: The smart scheduler is not optional. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backported from X.org: commit 9f9268821b13038556fbc029df54ab0e9b2aa77f Author: Mathieu BĂ©rard Date: Mon Aug 11 13:52:38 2008 -0400 The smart scheduler is not optional. Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 20 -------------- nx-X11/programs/Xserver/hw/nxagent/Display.c | 35 ------------------------ nx-X11/programs/Xserver/hw/nxagent/Display.h | 4 --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 36 ------------------------- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 12 --------- 5 files changed, 107 deletions(-) (limited to 'nx-X11/programs/Xserver/hw') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 46e01c737..3844fe046 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -2538,26 +2538,10 @@ void nxagentSetBufferSize() void nxagentSetScheduler() { - #ifdef DISABLE_SMART_SCHEDULE - - #ifdef SMART_SCHEDULE - - #ifdef TEST - fprintf(stderr, "nxagentSetScheduler: Disabling the smart scheduler.\n"); - #endif - - nxagentDisableTimer(); - - #endif - - #else /* #ifdef DISABLE_SMART_SCHEDULE */ - /* * The smart scheduler is the default. */ - #ifdef SMART_SCHEDULE - if (nxagentOption(Shadow) == 1) { #ifdef TEST @@ -2566,10 +2550,6 @@ void nxagentSetScheduler() nxagentDisableTimer(); } - - #endif - - #endif /* #ifdef DISABLE_SMART_SCHEDULE */ } void nxagentSetCoalescence() diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index d8e6aa7e3..eaee84855 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -597,8 +597,6 @@ Display *nxagentInternalOpenDisplay(char *display) int result; - #ifdef SMART_SCHEDULE - /* * Stop the smart schedule timer since * it uses SIGALRM as we do. @@ -606,8 +604,6 @@ Display *nxagentInternalOpenDisplay(char *display) nxagentStopTimer(); - #endif - /* * Install the handler rejecting a possible * loopback connection. @@ -678,16 +674,12 @@ static void nxagentDisplayBlockHandler(Display *display, int reason) * for the remote display. */ - #ifdef SMART_SCHEDULE - #ifdef DEBUG fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Stopping the smart schedule timer.\n"); #endif nxagentStopTimer(); - #endif - if (reason == NXBlockRead) { #ifdef DEBUG @@ -702,13 +694,9 @@ static void nxagentDisplayBlockHandler(Display *display, int reason) nxagentBlocking = 1; - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - /* * Let the dispatch attend the next * client. @@ -723,12 +711,8 @@ static void nxagentDisplayBlockHandler(Display *display, int reason) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - #ifdef SMART_SCHEDULE - } - #endif - /* * Give a chance to the next client. */ @@ -1022,12 +1006,8 @@ void nxagentInstallSignalHandlers() * Reset the SIGALRM to the default. */ - #ifdef SMART_SCHEDULE - nxagentStopTimer(); - #endif - newAction.sa_handler = SIG_DFL; sigfillset(&newAction.sa_mask); @@ -1040,8 +1020,6 @@ void nxagentInstallSignalHandlers() FatalError("Can't set the handler for alarm signal."); } - #ifdef SMART_SCHEDULE - /* * Let the smart schedule set the SIGALRM * handler again. @@ -1049,8 +1027,6 @@ void nxagentInstallSignalHandlers() nxagentInitTimer(); - #endif - /* * Install our own handler for the SIGHUP. */ @@ -1146,12 +1122,8 @@ void nxagentResetSignalHandlers() * Reset the SIGALRM to the default. */ - #ifdef SMART_SCHEDULE - nxagentStopTimer(); - #endif - newAction.sa_handler = SIG_DFL; sigfillset(&newAction.sa_mask); @@ -1164,8 +1136,6 @@ void nxagentResetSignalHandlers() FatalError("Can't set the handler for alarm signal."); } - #ifdef SMART_SCHEDULE - /* * Let the smart schedule set the SIGALRM * handler again. @@ -1173,7 +1143,6 @@ void nxagentResetSignalHandlers() nxagentInitTimer(); - #endif } void nxagentOpenDisplay(int argc, char *argv[]) @@ -2969,16 +2938,12 @@ void nxagentWaitDisplay() * Disable the smart scheduler's interrupts. */ - #ifdef SMART_SCHEDULE - #ifdef DEBUG fprintf(stderr, "nxagentWaitDisplay: Stopping the smart schedule timer.\n"); #endif nxagentStopTimer(); - #endif - if (nxagentDisplay != NULL) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.h b/nx-X11/programs/Xserver/hw/nxagent/Display.h index fe8ae1d43..75da371d8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.h @@ -116,8 +116,6 @@ Bool nxagentReconnectDisplay(void *p0); * Deal with the smart scheduler. */ -#ifdef SMART_SCHEDULE - #define nxagentInitTimer() \ \ SmartScheduleInit(); @@ -149,8 +147,6 @@ Bool nxagentReconnectDisplay(void *p0); \ SmartScheduleDisable = 1; -#endif /* #ifdef SMART_SCHEDULE */ - /* * File descriptor currently used by * Xlib for the agent display. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 1721be9fb..8e80a1524 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -564,16 +564,12 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * the client is scheduled in. */ - #ifdef SMART_SCHEDULE - #ifdef DEBUG fprintf(stderr, "nxagentBlockHandler: Stopping the smart schedule timer.\n"); #endif nxagentStopTimer(); - #endif - nxagentPrintGeometry(); #ifdef BLOCKS @@ -601,13 +597,9 @@ void nxagentWakeupHandler(void * data, int count, void * mask) nxagentHandleConnectionStates(); } - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - #ifdef DEBUG fprintf(stderr, "nxagentWakeupHandler: Resetting the dispatch state after wakeup.\n"); #endif @@ -617,12 +609,8 @@ void nxagentWakeupHandler(void * data, int count, void * mask) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - #ifdef SMART_SCHEDULE - } - #endif - /* * Can become true during the dispatch loop. */ @@ -897,13 +885,9 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) nxagentHandleConnectionStates(); } - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - #ifdef DEBUG fprintf(stderr, "nxagentShadowWakeupHandler: Resetting the dispatch state after wakeup.\n"); #endif @@ -913,12 +897,8 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - #ifdef SMART_SCHEDULE - } - #endif - /* * Can become true during the dispatch loop. */ @@ -1095,13 +1075,9 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) #endif } - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - /* * Pay attention to the next client if this * client produced enough output. @@ -1131,12 +1107,8 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) } #endif - #ifdef SMART_SCHEDULE - } - #endif - return; } else if (in > 0) @@ -1178,13 +1150,9 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) * the inner dispatch loop forever. */ - #ifdef SMART_SCHEDULE - if (SmartScheduleDisable == 1) { - #endif - if (client -> index != nxagentDispatch.client) { #ifdef DEBUG @@ -1230,12 +1198,8 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) #endif } - #ifdef SMART_SCHEDULE - } - #endif - } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 452fe8c43..8fc6cf5fd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -241,9 +241,7 @@ Dispatch(void) register ClientPtr client; register int nready; register HWEventQueuePtr* icheck = checkForInput; -#ifdef SMART_SCHEDULE long start_tick; -#endif unsigned long currentDispatch = 0; @@ -389,13 +387,11 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio #endif -#ifdef SMART_SCHEDULE if (nready && !SmartScheduleDisable) { clientReady[0] = SmartScheduleClient (clientReady, nready); nready = 1; } -#endif /***************** * Handle events in round robin fashion, doing input between * each round @@ -418,9 +414,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio isItTimeToYield = FALSE; requestingClient = client; -#ifdef SMART_SCHEDULE start_tick = SmartScheduleTime; -#endif while (!isItTimeToYield) { if (*icheck[0] != *icheck[1]) @@ -428,7 +422,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ProcessInputEvents(); FlushIfCriticalOutputPending(); } -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable && (SmartScheduleTime - start_tick) >= SmartScheduleSlice) { @@ -437,7 +430,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio client->smart_priority--; break; } -#endif /* now, finally, deal with client requests */ #ifdef TEST @@ -535,11 +527,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio #endif } FlushAllOutput(); -#ifdef SMART_SCHEDULE client = clients[clientReady[nready]]; if (client) client->smart_stop_tick = SmartScheduleTime; -#endif requestingClient = NULL; } dispatchException &= ~DE_PRIORITYCHANGE; @@ -1318,9 +1308,7 @@ CloseDownClient(register ClientPtr client) if (client->index < nextFreeClientID) nextFreeClientID = client->index; clients[client->index] = NullClient; -#ifdef SMART_SCHEDULE SmartLastClient = NullClient; -#endif free(client); while (!clients[currentMaxClients-1]) -- cgit v1.2.3