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/os/WaitFor.c | 14 -------------- nx-X11/programs/Xserver/os/io.c | 6 ------ nx-X11/programs/Xserver/os/osinit.c | 4 ---- nx-X11/programs/Xserver/os/utils.c | 9 --------- 4 files changed, 33 deletions(-) (limited to 'nx-X11/programs/Xserver/os') diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index 899b1de0b..0ecca8b7a 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -190,9 +190,7 @@ WaitForSomething(int *pClientsReady) int nready; fd_set devicesReadable; CARD32 now = 0; -#ifdef SMART_SCHEDULE Bool someReady = FALSE; -#endif #if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) fprintf(stderr, "WaitForSomething: Got called.\n"); @@ -215,7 +213,6 @@ WaitForSomething(int *pClientsReady) ProcessWorkQueue(); if (XFD_ANYSET (&ClientsWithInput)) { -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable) { someReady = TRUE; @@ -224,13 +221,11 @@ WaitForSomething(int *pClientsReady) wt = &waittime; } else -#endif { XFD_COPYSET (&ClientsWithInput, &clientsReadable); break; } } -#ifdef SMART_SCHEDULE if (someReady) { XFD_COPYSET(&AllSockets, &LastSelectMask); @@ -238,7 +233,6 @@ WaitForSomething(int *pClientsReady) } else { -#endif wt = NULL; if (timers) { @@ -252,10 +246,8 @@ WaitForSomething(int *pClientsReady) wt = &waittime; } XFD_COPYSET(&AllSockets, &LastSelectMask); -#ifdef SMART_SCHEDULE } SmartScheduleIdle = TRUE; -#endif BlockHandler((void *)&wt, (void *)&LastSelectMask); if (NewOutputPending) FlushAllOutput(); @@ -394,7 +386,6 @@ WaitForSomething(int *pClientsReady) i = XTestProcessInputAction (i, &waittime); } #endif /* XTESTEXT1 */ -#ifdef SMART_SCHEDULE if (i >= 0) { SmartScheduleIdle = FALSE; @@ -402,7 +393,6 @@ WaitForSomething(int *pClientsReady) if (SmartScheduleTimerStopped) (void) SmartScheduleStartTimer (); } -#endif if (i <= 0) /* An error or timeout occurred */ { #if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) @@ -442,7 +432,6 @@ WaitForSomething(int *pClientsReady) selecterr); } } -#ifdef SMART_SCHEDULE else if (someReady) { /* @@ -452,7 +441,6 @@ WaitForSomething(int *pClientsReady) XFD_COPYSET(&ClientsWithInput, &clientsReadable); break; } -#endif #if defined(NX_TRANS_SOCKET) if (*checkForInput[0] != *checkForInput[1]) { @@ -499,10 +487,8 @@ WaitForSomething(int *pClientsReady) return 0; } } -#ifdef SMART_SCHEDULE if (someReady) XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask); -#endif if (AnyClientsWriteBlocked && XFD_ANYSET (&clientsWritable)) { NewOutputPending = TRUE; diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index 3771d40fb..87739cfb1 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -430,11 +430,9 @@ ReadRequestFromClient(ClientPtr client) FD_SET(fd, &ClientsWithInput); else { -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable) FD_CLR(fd, &ClientsWithInput); else -#endif YieldControlNoInput(); } } @@ -442,16 +440,12 @@ ReadRequestFromClient(ClientPtr client) { if (!gotnow) AvailableInput = oc; -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable) FD_CLR(fd, &ClientsWithInput); else -#endif YieldControlNoInput(); } -#ifdef SMART_SCHEDULE if (SmartScheduleDisable) -#endif if (++timesThisConnection >= MAX_TIMES_PER) YieldControl(); #ifdef BIGREQS diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index 7aa961a56..59b567356 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -55,9 +55,7 @@ SOFTWARE. #include "osdep.h" #include -#ifdef SMART_SCHEDULE #include "dixstruct.h" -#endif #ifndef PATH_MAX #ifdef MAXPATHLEN @@ -216,11 +214,9 @@ OsInit(void) * log file name if logging to a file is desired. */ LogInit(NULL, NULL); -#ifdef SMART_SCHEDULE if (!SmartScheduleDisable) if (!SmartScheduleInit ()) SmartScheduleDisable = TRUE; -#endif OsInitAllocator(); if (!OsDelayInitColors) OsInitColors(); } diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 5f7542a2d..204494d63 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -134,9 +134,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include "opaque.h" -#ifdef SMART_SCHEDULE #include "dixstruct.h" -#endif #ifdef XKB #include "xkbsrv.h" @@ -635,10 +633,8 @@ void UseMsg(void) ErrorF("+rrxinerama Enable XINERAMA (via RandR) extension (default)\n"); ErrorF("-rrxinerama Disable XINERAMA (via RandR) extension\n"); #endif -#ifdef SMART_SCHEDULE ErrorF("-dumbSched Disable smart scheduling, enable old behavior\n"); ErrorF("-schedInterval int Set scheduler interval in msec\n"); -#endif ErrorF("+extension name Enable extension\n"); ErrorF("-extension name Disable extension\n"); #ifdef XDMCP @@ -1038,7 +1034,6 @@ ProcessCommandLine(int argc, char *argv[]) i = skip - 1; } #endif -#ifdef SMART_SCHEDULE else if ( strcmp( argv[i], "-dumbSched") == 0) { SmartScheduleDisable = TRUE; @@ -1062,7 +1057,6 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } -#endif #ifdef RENDER else if ( strcmp( argv[i], "-render" ) == 0) { @@ -1367,8 +1361,6 @@ XNFstrdup(const char *s) return ret; } -#ifdef SMART_SCHEDULE - unsigned long SmartScheduleIdleCount; Bool SmartScheduleIdle; Bool SmartScheduleTimerStopped; @@ -1494,7 +1486,6 @@ SmartScheduleInit (void) return FALSE; #endif } -#endif #ifdef SIG_BLOCK static sigset_t PreviousSignalMask; -- cgit v1.2.3