The smart scheduler is not optional.

This commit is contained in:
Mathieu Bérard 2008-08-11 13:52:38 -04:00 committed by Adam Jackson
parent 2e2ce817ce
commit 9f9268821b
11 changed files with 0 additions and 63 deletions

View File

@ -1041,7 +1041,6 @@ AC_SUBST([VENDOR_NAME_SHORT])
AC_SUBST([VENDOR_RELEASE])
AC_SUBST([VENDOR_MAN_VERSION])
AC_DEFINE(SMART_SCHEDULE, 1, [Include time-based scheduler])
AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
if test "x$DEBUGGING" = xyes; then

View File

@ -90,9 +90,7 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
if (pDamageClient->critical > 0)
{
SetCriticalOutputPending ();
#ifdef SMART_SCHEDULE
pClient->smart_priority = SMART_MAX_PRIORITY;
#endif
}
}

View File

@ -237,7 +237,6 @@ UpdateCurrentTimeIf(void)
currentTime = systime;
}
#ifdef SMART_SCHEDULE
#undef SMART_DEBUG
@ -338,7 +337,6 @@ SmartScheduleClient (int *clientReady, int nready)
}
return best;
}
#endif
#define MAJOROP ((xReq *)client->requestBuffer)->reqType
@ -350,9 +348,7 @@ Dispatch(void)
ClientPtr client;
int nready;
HWEventQueuePtr* icheck = checkForInput;
#ifdef SMART_SCHEDULE
long start_tick;
#endif
nextFreeClientID = 1;
nClients = 0;
@ -371,13 +367,11 @@ Dispatch(void)
nready = WaitForSomething(clientReady);
#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
@ -399,16 +393,13 @@ Dispatch(void)
}
isItTimeToYield = FALSE;
#ifdef SMART_SCHEDULE
start_tick = SmartScheduleTime;
#endif
while (!isItTimeToYield)
{
if (*icheck[0] != *icheck[1])
ProcessInputEvents();
FlushIfCriticalOutputPending();
#ifdef SMART_SCHEDULE
if (!SmartScheduleDisable &&
(SmartScheduleTime - start_tick) >= SmartScheduleSlice)
{
@ -417,7 +408,6 @@ Dispatch(void)
client->smart_priority--;
break;
}
#endif
/* now, finally, deal with client requests */
result = ReadRequestFromClient(client);
@ -465,11 +455,9 @@ Dispatch(void)
}
}
FlushAllOutput();
#ifdef SMART_SCHEDULE
client = clients[clientReady[nready]];
if (client)
client->smart_stop_tick = SmartScheduleTime;
#endif
}
dispatchException &= ~DE_PRIORITYCHANGE;
}
@ -3453,9 +3441,7 @@ CloseDownClient(ClientPtr client)
if (client->index < nextFreeClientID)
nextFreeClientID = client->index;
clients[client->index] = NullClient;
#ifdef SMART_SCHEDULE
SmartLastClient = NullClient;
#endif
dixFreePrivates(client->devPrivates);
xfree(client);
@ -3505,12 +3491,10 @@ void InitClient(ClientPtr client, int i, pointer ospriv)
#endif
client->replyBytesRemaining = 0;
client->fontResFunc = NULL;
#ifdef SMART_SCHEDULE
client->smart_priority = 0;
client->smart_start_tick = SmartScheduleTime;
client->smart_stop_tick = SmartScheduleTime;
client->smart_check_tick = SmartScheduleTime;
#endif
client->clientPtr = NULL;
}

View File

@ -2014,10 +2014,8 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
if (BitIsOn(criticalEvents, type))
{
#ifdef SMART_SCHEDULE
if (client->smart_priority < SMART_MAX_PRIORITY)
client->smart_priority++;
#endif
SetCriticalOutputPending();
}

View File

@ -252,9 +252,6 @@
/* Support SHAPE extension */
#undef SHAPE
/* Include time-based scheduler */
#undef SMART_SCHEDULE
/* Define to 1 on systems derived from System V Release 4 */
#undef SVR4

View File

@ -129,17 +129,14 @@ typedef struct _Client {
struct _FontResolution * (*fontResFunc) ( /* no need for font.h */
ClientPtr /* pClient */,
int * /* num */);
#ifdef SMART_SCHEDULE
int smart_priority;
long smart_start_tick;
long smart_stop_tick;
long smart_check_tick;
#endif
DeviceIntPtr clientPtr;
} ClientRec;
#ifdef SMART_SCHEDULE
/*
* Scheduling interface
*/
@ -155,7 +152,6 @@ extern void SmartScheduleStopTimer(void);
extern Bool SmartScheduleInit(void);
#endif
/* This prototype is used pervasively in Xext, dix */
#define DISPATCH_PROC(func) int func(ClientPtr /* client */)

View File

@ -61,9 +61,6 @@
/* Support SHAPE extension */
#undef SHAPE
/* Include time-based scheduler */
#undef SMART_SCHEDULE
/* Define to 1 on systems derived from System V Release 4 */
#undef SVR4

View File

@ -155,9 +155,7 @@ WaitForSomething(int *pClientsReady)
int nready;
fd_set devicesReadable;
CARD32 now = 0;
#ifdef SMART_SCHEDULE
Bool someReady = FALSE;
#endif
FD_ZERO(&clientsReadable);
@ -170,7 +168,6 @@ WaitForSomething(int *pClientsReady)
ProcessWorkQueue();
if (XFD_ANYSET (&ClientsWithInput))
{
#ifdef SMART_SCHEDULE
if (!SmartScheduleDisable)
{
someReady = TRUE;
@ -179,13 +176,11 @@ WaitForSomething(int *pClientsReady)
wt = &waittime;
}
else
#endif
{
XFD_COPYSET (&ClientsWithInput, &clientsReadable);
break;
}
}
#ifdef SMART_SCHEDULE
if (someReady)
{
XFD_COPYSET(&AllSockets, &LastSelectMask);
@ -193,7 +188,6 @@ WaitForSomething(int *pClientsReady)
}
else
{
#endif
wt = NULL;
if (timers)
{
@ -215,11 +209,9 @@ WaitForSomething(int *pClientsReady)
}
}
XFD_COPYSET(&AllSockets, &LastSelectMask);
#ifdef SMART_SCHEDULE
}
SmartScheduleStopTimer ();
#endif
BlockHandler((pointer)&wt, (pointer)&LastSelectMask);
if (NewOutputPending)
FlushAllOutput();
@ -237,9 +229,7 @@ WaitForSomething(int *pClientsReady)
}
selecterr = GetErrno();
WakeupHandler(i, (pointer)&LastSelectMask);
#ifdef SMART_SCHEDULE
SmartScheduleStartTimer ();
#endif
if (i <= 0) /* An error or timeout occurred */
{
if (dispatchException)
@ -263,7 +253,6 @@ WaitForSomething(int *pClientsReady)
strerror(selecterr));
}
}
#ifdef SMART_SCHEDULE
else if (someReady)
{
/*
@ -273,7 +262,6 @@ WaitForSomething(int *pClientsReady)
XFD_COPYSET(&ClientsWithInput, &clientsReadable);
break;
}
#endif
if (*checkForInput[0] != *checkForInput[1])
return 0;
@ -310,10 +298,8 @@ WaitForSomething(int *pClientsReady)
return 0;
}
}
#ifdef SMART_SCHEDULE
if (someReady)
XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask);
#endif
if (AnyClientsWriteBlocked && XFD_ANYSET (&clientsWritable))
{
NewOutputPending = TRUE;

View File

@ -411,11 +411,9 @@ ReadRequestFromClient(ClientPtr client)
FD_SET(fd, &ClientsWithInput);
else
{
#ifdef SMART_SCHEDULE
if (!SmartScheduleDisable)
FD_CLR(fd, &ClientsWithInput);
else
#endif
YieldControlNoInput();
}
}
@ -423,16 +421,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();
if (move_header)

View File

@ -55,9 +55,7 @@ SOFTWARE.
#include "osdep.h"
#include <X11/Xos.h>
#ifdef SMART_SCHEDULE
#include "dixstruct.h"
#endif
#ifndef PATH_MAX
#ifdef MAXPATHLEN
@ -199,11 +197,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
}
void

View File

@ -111,9 +111,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include "opaque.h"
#ifdef SMART_SCHEDULE
#include "dixstruct.h"
#endif
#ifdef XKB
#include <xkbsrv.h>
@ -552,10 +550,8 @@ void UseMsg(void)
ErrorF("+xinerama Enable XINERAMA extension\n");
ErrorF("-xinerama Disable XINERAMA 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
@ -926,7 +922,6 @@ ProcessCommandLine(int argc, char *argv[])
i = skip - 1;
}
#endif
#ifdef SMART_SCHEDULE
else if ( strcmp( argv[i], "-dumbSched") == 0)
{
SmartScheduleDisable = TRUE;
@ -950,7 +945,6 @@ ProcessCommandLine(int argc, char *argv[])
else
UseMsg();
}
#endif
#ifdef RENDER
else if ( strcmp( argv[i], "-render" ) == 0)
{
@ -1234,7 +1228,6 @@ XNFstrdup(const char *s)
return sd;
}
#ifdef SMART_SCHEDULE
#ifdef SIGVTALRM
#define SMART_SCHEDULE_POSSIBLE
@ -1310,7 +1303,6 @@ SmartScheduleInit (void)
return FALSE;
#endif
}
#endif
#ifdef SIG_BLOCK
static sigset_t PreviousSignalMask;