From: Con Kolivas <kernel@kolivas.org>

Tiny tweak to keep top two interactive levels round robin at the fastest
(10ms) which keeps X smooth when another interactive task is also using
bursts of cpu (eg web browser).



 25-akpm/kernel/sched.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff -puN kernel/sched.c~o20.1int kernel/sched.c
--- 25/kernel/sched.c~o20.1int	Wed Sep 10 10:48:39 2003
+++ 25-akpm/kernel/sched.c	Wed Sep 10 10:48:39 2003
@@ -14,6 +14,7 @@
  *		an array-switch method of distributing timeslices
  *		and per-CPU runqueues.  Cleanups and useful suggestions
  *		by Davide Libenzi, preemptible kernel bits by Robert Love.
+ *  2003-09-03	Interactivity tuning by Con Kolivas.
  */
 
 #include <linux/mm.h>
@@ -123,12 +124,12 @@
 		MAX_SLEEP_AVG)
 
 #ifdef CONFIG_SMP
-#define TIMESLICE_GRANULARITY(p) \
-	(MIN_TIMESLICE * (1 << (MAX_BONUS - CURRENT_BONUS(p))) * \
-		num_online_cpus())
+#define TIMESLICE_GRANULARITY(p)	(MIN_TIMESLICE * \
+		(1 << (((MAX_BONUS - CURRENT_BONUS(p)) ? : 1) - 1)) * \
+			num_online_cpus())
 #else
-#define TIMESLICE_GRANULARITY(p) \
-	(MIN_TIMESLICE * (1 << (MAX_BONUS - CURRENT_BONUS(p))))
+#define TIMESLICE_GRANULARITY(p)	(MIN_TIMESLICE * \
+		(1 << (((MAX_BONUS - CURRENT_BONUS(p)) ? : 1) - 1)))
 #endif
 
 #define SCALE(v1,v1_max,v2_max) \

_