linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] O3int interactivity for 2.5.74-mm2
@ 2003-07-06 17:16 Con Kolivas
  2003-07-06 18:36 ` Felipe Alfaro Solana
  0 siblings, 1 reply; 31+ messages in thread
From: Con Kolivas @ 2003-07-06 17:16 UTC (permalink / raw)
  To: linux kernel mailing list; +Cc: Andrew Morton

[-- Attachment #1: clearsigned data --]
[-- Type: Text/Plain, Size: 1204 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attached is an incremental patch against 2.5.74-mm2 with more interactivity 
work. Audio should be quite resistant to skips with this, and it should not 
induce further unfairness.

Changes:
The sleep_avg buffer was not needed with the improved semantics in O2int so it 
has been removed entirely as it created regressions in O2int.

A small change to the idle detection code to only make tasks with enough 
accumulated sleep_avg become idle.

Minor cleanups and clarified code.


Other issues:
Jerky mouse with heavy page rendering in web browsers remains. This is a 
different issue to the audio and will need some more thought.

The patch is also available for download here:
http://kernel.kolivas.org/2.5

Note for those who wish to get smooth X desktop feel now for their own use, 
the granularity patch on that website will do wonders on top of O3int, but a 
different approach will be needed for mainstream consumption.

Con
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/CFmHF6dfvkL3i1gRAkqTAKCjE3lRwBWomZbn/asWtv+OWiFovQCfZo0P
UfqOKVgv88faks6+vPq5BGM=
=ZR4Y
-----END PGP SIGNATURE-----

[-- Attachment #2: patch-O3int-0307070226 --]
[-- Type: text/x-diff, Size: 1553 bytes --]

--- linux-2.5.74/kernel/sched.c	2003-07-07 02:13:57.000000000 +1000
+++ linux-2.5.74-test/kernel/sched.c	2003-07-07 02:58:47.000000000 +1000
@@ -77,6 +77,7 @@
 #define MAX_SLEEP_AVG		(10*HZ)
 #define STARVATION_LIMIT	(10*HZ)
 #define NODE_THRESHOLD		125
+#define MAX_BONUS		((MAX_USER_PRIO - MAX_RT_PRIO) * PRIO_BONUS_RATIO / 100)
 
 /*
  * If a task is 'interactive' then we reinsert it in the active
@@ -306,7 +307,7 @@ static inline void normalise_sleep(task_
 {
 	unsigned long old_avg_time = jiffies - p->avg_start;
 
-	if (old_avg_time < MIN_SLEEP_AVG)
+	if (unlikely(old_avg_time < MIN_SLEEP_AVG))
 		return;
 
 	if (p->sleep_avg > MAX_SLEEP_AVG)
@@ -406,21 +407,16 @@ static inline void activate_task(task_t 
 		 */
 		if (runtime < MAX_SLEEP_AVG)
 			p->sleep_avg += (runtime - p->sleep_avg) * (MAX_SLEEP_AVG - runtime) *
-				(10 - INTERACTIVE_DELTA) / 10 / MAX_SLEEP_AVG;
+				(MAX_BONUS - INTERACTIVE_DELTA) / MAX_BONUS / MAX_SLEEP_AVG;
 
-		/*
-		 * Keep a buffer of 10% sleep_avg
-		 * to prevent short bursts of cpu activity from making
-		 * interactive tasks lose their bonus
-		 */
-		if (p->sleep_avg > MAX_SLEEP_AVG * 11/10)
-			p->sleep_avg = MAX_SLEEP_AVG * 11/10;
+		if (p->sleep_avg > MAX_SLEEP_AVG)
+			p->sleep_avg = MAX_SLEEP_AVG;
 
 		/*
 		 * Tasks that sleep a long time are categorised as idle and
 		 * get their static priority only
 		 */
-		if (sleep_time > MIN_SLEEP_AVG)
+		if ((sleep_time > MIN_SLEEP_AVG) && (p->sleep_avg > runtime / 2))
 			p->sleep_avg = runtime / 2;
 
 		if (unlikely(p->avg_start > jiffies)){

^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: [PATCH] O3int interactivity for 2.5.74-mm2
@ 2003-07-09 15:08 Luis Miguel Garcia
  0 siblings, 0 replies; 31+ messages in thread
From: Luis Miguel Garcia @ 2003-07-09 15:08 UTC (permalink / raw)
  To: linux-kernel

If the prople is all the time complaining about the good that was the
interactivity in the first 2.5 series, is it completly imposible to
revert some of the changes in order to see what has happened?

Perhaps this way, a bug can be identified, or a bad piece of code.

Does this make sense?

Regards,
-- 
Luis Miguel Garcia
Palencia / Spain


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2003-07-10 16:09 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-06 17:16 [PATCH] O3int interactivity for 2.5.74-mm2 Con Kolivas
2003-07-06 18:36 ` Felipe Alfaro Solana
2003-07-06 21:14   ` Con Kolivas
2003-07-06 21:17   ` Con Kolivas
2003-07-07  3:19   ` Con Kolivas
2003-07-07  9:13     ` Felipe Alfaro Solana
2003-07-07  9:40     ` Mike Galbraith
2003-07-07 10:25       ` Con Kolivas
2003-07-07 14:06         ` Mike Galbraith
2003-07-07 14:10           ` Con Kolivas
2003-07-07 10:51     ` Nick Sanders
2003-07-07 12:19       ` Marc-Christian Petersen
2003-07-07 13:14         ` Con Kolivas
2003-07-08  0:31         ` Zwane Mwaikambo
2003-07-09 10:12           ` Marc-Christian Petersen
2003-07-09 10:13             ` Marc-Christian Petersen
2003-07-09 10:22             ` Con Kolivas
2003-07-09 10:23               ` Marc-Christian Petersen
2003-07-09 10:37                 ` Con Kolivas
2003-07-09 10:40                   ` Marc-Christian Petersen
2003-07-07 13:25     ` Helge Hafting
2003-07-08  6:35     ` Alex Riesen
2003-07-08  7:11     ` Szonyi Calin
2003-07-08  7:46       ` Davide Libenzi
2003-07-08  7:59         ` Con Kolivas
2003-07-08 15:12           ` Davide Libenzi
2003-07-08 20:54             ` Con Kolivas
2003-07-08 20:55               ` Davide Libenzi
2003-07-08  8:03       ` Con Kolivas
2003-07-10 16:27         ` Szonyi Calin
2003-07-09 15:08 Luis Miguel Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).