[PATCH] os: Turn off the scheduler alarm after an arbitrary length of time

Adam Jackson ajax at redhat.com
Thu Jul 29 14:41:10 PDT 2010


If we're stuck in some difficult bit of processing, there's no point in
punishing the client too strongly.  Worse, the continuous stream of
SIGALRM shows up in strace and thus people report "infinite stream of
SIGALRM" rather than whatever the bug actually is.

So if we're more than 10x past the maximum timeslice, just turn the
signal off.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 os/utils.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/os/utils.c b/os/utils.c
index 51455cc..a3be61d 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1163,6 +1163,9 @@ static void
 SmartScheduleTimer (int sig)
 {
     SmartScheduleTime += SmartScheduleInterval;
+
+    if (SmartScheduleTime >= 10 * SmartScheduleMaxSlice)
+	SmartScheduleStopTimer();
 }
 #endif
 
-- 
1.7.2



More information about the xorg-devel mailing list