Skip to contentSkip to conversation

adjust timeslice granularity

PATCH In review Con Kolivas 2 participants 2 messages Nov 2, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 adjust timeslice granularity

adjust timeslice granularity

The minimum timeslice was decreased from 10ms to 5ms. In the process, the timeslice granularity was leading to much more rapid round robinning of interactive tasks at cache trashing levels.

Restore minimum granularity to 10ms.

kernel/sched.c +4 -2
Index: linux-2.6.10-rc1-mm2/kernel/sched.c
===================================================================
@@ -133,12 +133,14 @@
 	(NS_TO_JIFFIES((p)->sleep_avg) * MAX_BONUS / \
 		MAX_SLEEP_AVG)
 
+#define GRANULARITY	(10 * HZ / 1000 ? : 1)
+
 #ifdef CONFIG_SMP
-#define TIMESLICE_GRANULARITY(p)	(MIN_TIMESLICE * \
+#define TIMESLICE_GRANULARITY(p)	(GRANULARITY * \
 		(1 << (((MAX_BONUS - CURRENT_BONUS(p)) ? : 1) - 1)) * \
 			num_online_cpus())
 #else
-#define TIMESLICE_GRANULARITY(p)	(MIN_TIMESLICE * \
+#define TIMESLICE_GRANULARITY(p)	(GRANULARITY * \
 		(1 << (((MAX_BONUS - CURRENT_BONUS(p)) ? : 1) - 1)))
 #endif
 
#1 lore raw
Quoted 1 line · Con Kolivas

adjust timeslice granularity

this too is of the 'could potentially hurt interactivity' type and needs -mm exposure and is 2.6.11 material at the earliest. Looks good and sound otherwise.

Ingo