Skip to contentSkip to conversation

O1int for 2.5.73

PATCH In review Con Kolivas 2 participants 2 messages Jun 27, 2003 – Jun 28, 2003

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 O1int for 2.5.73

Here is an updated version of the O1int patch designed to improve interactivity.

This change addresses the difficulty of new tasks in heavy load being recognised as interactive by decreasing the amount of time considered in the interactivity equation, but dropping that decrease exponentially till it gets to the MAX_SLEEP_AVG.

This should improve the startup time of new apps in heavy load and lessen audio stalls when loads are high _and_ then the audio app is started.

Please test and comment.

Con

include/linux/sched.h +1 -0
diff -Naurp linux-2.5.73/include/linux/sched.h linux-2.5.73-test/include/linux/sched.h
@@ -336,6 +336,7 @@ struct task_struct {
 	prio_array_t *array;
 
 	unsigned long sleep_avg;
+	unsigned long avg_start;
 	unsigned long last_run;
 
 	unsigned long policy;
kernel/fork.c +1 -0
diff -Naurp linux-2.5.73/kernel/fork.c linux-2.5.73-test/kernel/fork.c
@@ -863,6 +863,7 @@ struct task_struct *copy_process(unsigne
 	p->array = NULL;
 	p->lock_depth = -1;		/* -1 = no lock */
 	p->start_time = get_jiffies_64();
+	p->avg_start = jiffies;
 	p->security = NULL;
 
 	retval = -ENOMEM;
kernel/sched.c +23 -18

83 lines not on this page · raw message

#1 lore raw

Re: [PATCH] O1int for 2.5.73 - sched tuning sysctl

Quoted 8 lines · Con Kolivas

Here is an updated version of the O1int patch designed to improve interactivity.

This change addresses the difficulty of new tasks in heavy load being recognised as interactive by decreasing the amount of time considered in the interactivity equation, but dropping that decrease exponentially till it gets to the MAX_SLEEP_AVG.

Quoted 6 lines

This should improve the startup time of new apps in heavy load and lessen audio stalls when loads are high _and_ then the audio app is started.

Please test and comment.

Con

Well, I've just been following this thread and I choose to make a small patch against your O1 int to export the scheduler tuning knobs via sysctl. This patch will create /proc/sys/kernel/sched_tuning and expose all the knobs, sou you guys don't have to recompile and reboot just to change, say, max_sleep_avg. Don't know if anybody will find it useful, but at least it doesn't hurts :-)
It should apply cleanly against plain 2.5.73, altough I didn't tested.

wrt your patch, I must admit I didn't feel any difference from vanilla 2.5.73, but this feeling isn't much scientific 8). I will do some serious tests tomorrow if I find any time.

Roberto

include/linux/sysctl.h +16 -0
diff -Nur -X dontdiff linux-2.5.73-O1int/include/linux/sysctl.h linux-2.5.73-test/include/linux/sysctl.h
@@ -130,6 +130,7 @@
 	KERN_PIDMAX=55,		/* int: PID # limit */
   	KERN_CORE_PATTERN=56,	/* string: pattern for core-file names */
 	KERN_PANIC_ON_OOPS=57,  /* int: whether we will panic on an oops */
+	KERN_SCHED_TUNING=58	/* dir: scheduler tuning */
 };
 
 
@@ -193,6 +194,21 @@
 	RANDOM_UUID=6
 };
 
+/* /proc/sys/kernel/sched_tuning */
+enum
+{
+	SCHED_TUNING_MIN_TIMESLICE=1,
+	SCHED_TUNING_MAX_TIMESLICE=2,
+	SCHED_TUNING_BONUS_RATIO=3,
+	SCHED_TUNING_MAX_SLEEP_AVG=4,
+	SCHED_TUNING_STARVATION_LIMIT=5,
+	SCHED_TUNING_CHILD_PENALTY=6,
+	SCHED_TUNING_PARENT_PENALTY=7,
+	SCHED_TUNING_EXIT_WEIGHT=8,
+	SCHED_TUNING_INTERACTIVE_DELTA=9,
+	SCHED_TUNING_NODE_THRESHOLD=10
+};
+
 /* /proc/sys/bus/isa */
 enum
 {
kernel/sched.c +22 -10
diff -Nur -X dontdiff linux-2.5.73-O1int/kernel/sched.c linux-2.5.73-test/kernel/sched.c
@@ -65,16 +65,28 @@
  * maximum timeslice is 200 msecs. Timeslices get refilled after
  * they expire.
  */
-#define MIN_TIMESLICE		( 10 * HZ / 1000)
-#define MAX_TIMESLICE		(200 * HZ / 1000)
-#define CHILD_PENALTY		50
-#define PARENT_PENALTY		100
-#define EXIT_WEIGHT		3
-#define PRIO_BONUS_RATIO	25
-#define INTERACTIVE_DELTA	2
-#define MAX_SLEEP_AVG		(10*HZ)
-#define STARVATION_LIMIT	(10*HZ)
-#define NODE_THRESHOLD		125
+int sched_min_timeslice 	= ( 10 * HZ / 1000);
+int sched_max_timeslice 	= (200 * HZ / 1000);
+int sched_prio_bonus_ratio	= 25;
+int sched_max_sleep_avg		= (10*HZ);
+int sched_starvation_limit	= (10*HZ);
+int sched_child_penalty		= 50;
+int sched_parent_penalty	= 100;
+int sched_exit_weight		= 3;
+int sched_interactive_delta 	= 2;
+int sched_node_threshold	= 125;
+
+
+#define MIN_TIMESLICE		sched_min_timeslice
+#define MAX_TIMESLICE		sched_max_timeslice
+#define CHILD_PENALTY		sched_child_penalty
+#define PARENT_PENALTY		sched_parent_penalty
+#define EXIT_WEIGHT		sched_exit_weight
+#define PRIO_BONUS_RATIO	sched_prio_bonus_ratio
+#define INTERACTIVE_DELTA	sched_interactive_delta
+#define MAX_SLEEP_AVG		sched_max_sleep_avg
+#define STARVATION_LIMIT	sched_starvation_limit
+#define NODE_THRESHOLD		sched_node_threshold
 
 /*
  * If a task is 'interactive' then we reinsert it in the active
kernel/sysctl.c +112 -0

136 lines not on this page · raw message