summaryrefslogtreecommitdiff
path: root/dix/dispatch.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2013-11-05 10:20:04 -0500
committerAdam Jackson <ajax@redhat.com>2013-12-09 13:20:36 -0500
commitb61ccd5d9d368f3fbbae27ce14ac02a3db1884c4 (patch)
treebb8137203a1951d959a699ae31dd5139ff3ad30b /dix/dispatch.c
parent66310ea2893811614b3c3aade8992624a95a6ee7 (diff)
smartsched: Tweak the default scheduler intervals
A default timeslice of 20ms means a pathological client can ruin up to two frames per scheduler tick. And a fifth of a second is just insane. Pick two different numbers out of the hat. A 5ms slice means you can probably keep up with two or three abusive clients, and letting it burst to 15ms should give you about all the timeslice you need for a fullscreen game (that's doing server-side rendering for some reason). If you're running on a system with a 10ms granularity on SIGALRM, then this effectively changes the intervals to 10ms and 30ms. Which is still better, just not as better. I suspect this is about as good as we can do without actually going preemptive, which is an entire other nightmare. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'dix/dispatch.c')
-rw-r--r--dix/dispatch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 4fecfea7b..8dcd9cbcf 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -220,8 +220,9 @@ UpdateCurrentTimeIf(void)
#undef SMART_DEBUG
-#define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */
-#define SMART_SCHEDULE_MAX_SLICE 200 /* ms */
+/* in milliseconds */
+#define SMART_SCHEDULE_DEFAULT_INTERVAL 5
+#define SMART_SCHEDULE_MAX_SLICE 15
#if defined(WIN32) && !defined(__CYGWIN__)
Bool SmartScheduleDisable = TRUE;