public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.5.72 O(1) interactivity bugfix
@ 2003-06-18 14:43 Con Kolivas
  2003-06-18 17:59 ` Andreas Boman
  2003-06-18 18:05 ` Robert Love
  0 siblings, 2 replies; 15+ messages in thread
From: Con Kolivas @ 2003-06-18 14:43 UTC (permalink / raw)
  To: linux kernel mailing list; +Cc: Ingo Molnar

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

Hi Ingo, all

While messing with the interactivity code I found what appears to be an 
uninitialised variable (p->sleep_avg), which is responsible for all the 
boost/penalty in the scheduler. Initialising this variable to 0 seems to have 
made absolutely massive improvements to system responsiveness under load
and completely removed audio skips up to doing a make -j64 on my uniprocessor 
P4 (beyond which swap starts being used), without changing the scheduler 
timeslices. This seems to help all 2.4 O(1) based kernels as well. Attached 
is a patch against 2.5.72 but I'm not sure about the best place to initialise 
it.


diff -Naurp linux-2.5.72/kernel/fork.c linux-2.5.72-test/kernel/fork.c
- --- linux-2.5.72/kernel/fork.c	2003-06-18 22:47:25.000000000 +1000
+++ linux-2.5.72-test/kernel/fork.c	2003-06-19 00:30:26.000000000 +1000
@@ -864,6 +864,7 @@ struct task_struct *copy_process(unsigne
 	p->lock_depth = -1;		/* -1 = no lock */
 	p->start_time = get_jiffies_64();
 	p->security = NULL;
+	p->sleep_avg = 0;

 	retval = -ENOMEM;
 	if ((retval = security_task_alloc(p)))
diff -Naurp linux-2.5.72/kernel/sched.c linux-2.5.72-test/kernel/sched.c
- --- linux-2.5.72/kernel/sched.c	2003-06-18 22:47:25.000000000 +1000
+++ linux-2.5.72-test/kernel/sched.c	2003-06-19 00:28:19.000000000 +1000
@@ -1755,6 +1755,7 @@ static int setscheduler(pid_t pid, int p
 	if (array)
 		deactivate_task(p, task_rq(p));
 	retval = 0;
+	p->sleep_avg = 0;
 	p->policy = policy;
 	p->rt_priority = lp.sched_priority;
 	if (policy != SCHED_NORMAL)


I hope this is correct.

Regards,
Con
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+8Hp0F6dfvkL3i1gRAr/fAKCYbJ/yQhshqV7G43f+mQP4rZoKWgCfdD69
QuqYH58q6PdbD3qGFvjUKSs=
=huFo
-----END PGP SIGNATURE-----


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

end of thread, other threads:[~2003-06-19  9:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-18 14:43 [PATCH] 2.5.72 O(1) interactivity bugfix Con Kolivas
2003-06-18 17:59 ` Andreas Boman
2003-06-18 22:43   ` Con Kolivas
     [not found]     ` <1055977195.1077.41.camel@asgaard.midgaard.us>
2003-06-18 23:38       ` Con Kolivas
     [not found]         ` <1055983621.1753.23.camel@asgaard.midgaard.us>
2003-06-19  1:12           ` Con Kolivas
2003-06-19  2:00             ` Andreas Boman
2003-06-19  6:13             ` Mike Galbraith
2003-06-19  6:35               ` Con Kolivas
2003-06-19  8:11                 ` Con Kolivas
2003-06-19  7:33               ` Nick Piggin
2003-06-19  8:51                 ` Mike Galbraith
2003-06-19  8:57                   ` Nick Piggin
2003-06-19  9:00                     ` Nick Piggin
2003-06-19  9:18                     ` Mike Galbraith
2003-06-18 18:05 ` Robert Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox