linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] sched-2.5.64-D3, more interactivity changes
@ 2003-03-17 10:21 Ingo Molnar
  2003-03-17 18:01 ` Martin J. Bligh
  2003-03-19  5:52 ` Andrew Morton
  0 siblings, 2 replies; 11+ messages in thread
From: Ingo Molnar @ 2003-03-17 10:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mike Galbraith, Andrew Morton


the attached patch (against BK-curr) implements more finegrained timeslice
distribution, without changing the total balance of timeslices, by
recalculating the priority of CPU-bound tasks at a finer granularity, and
by roundrobining tasks. Right now this new granularity is 50 msecs (the
default timeslice for default priority tasks is 100 msecs).

Could people, who can reproduce 'audio skips' kind of problems even with
BK-curr, give this patch a go?

	Ingo

--- linux/kernel/sched.c.orig	
+++ linux/kernel/sched.c	
@@ -73,6 +73,7 @@
 #define INTERACTIVE_DELTA	2
 #define MAX_SLEEP_AVG		(10*HZ)
 #define STARVATION_LIMIT	(10*HZ)
+#define TIMESLICE_GRANULARITY	(HZ/20 ?: 1)
 #define NODE_THRESHOLD		125
 
 /*
@@ -1259,6 +1260,27 @@ void scheduler_tick(int user_ticks, int 
 			enqueue_task(p, rq->expired);
 		} else
 			enqueue_task(p, rq->active);
+	} else {
+		/*
+		 * Prevent a too long timeslice allowing a task to monopolize
+		 * the CPU. We do this by splitting up the timeslice into
+		 * smaller pieces.
+		 *
+		 * Note: this does not mean the task's timeslices expire or
+		 * get lost in any way, they just might be preempted by
+		 * another task of equal priority. (one with higher
+		 * priority would have preempted this task already.) We
+		 * requeue this task to the end of the list on this priority
+		 * level, which is in essence a round-robin of tasks with
+		 * equal priority.
+		 */
+		if (!(p->time_slice % TIMESLICE_GRANULARITY) &&
+			       		(p->array == rq->active)) {
+			dequeue_task(p, rq->active);
+			set_tsk_need_resched(p);
+			p->prio = effective_prio(p);
+			enqueue_task(p, rq->active);
+		}
 	}
 out:
 	spin_unlock(&rq->lock);


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [patch] sched-2.5.64-D3, more interactivity changes
@ 2003-03-18  0:28 Sean Estabrooks
  0 siblings, 0 replies; 11+ messages in thread
From: Sean Estabrooks @ 2003-03-18  0:28 UTC (permalink / raw)
  To: linux-kernel

On Mon, 17 Mar 2003 11:21:33 +0100, Ingo Molnar wrote:

> the attached patch (against BK-curr) implements more finegrained timeslice
> distribution, without changing the total balance of timeslices, by
> recalculating the priority of CPU-bound tasks at a finer granularity, and
> by roundrobining tasks. Right now this new granularity is 50 msecs (the
> default timeslice for default priority tasks is 100 msecs).
>
> Could people, who can reproduce 'audio skips' kind of problems even with
> BK-curr, give this patch a go?
>
>       Ingo

An enthusiastic, Works For Me (tm)....

Linux version 2.5.64
(gcc version 3.2.2 20030217 (Red Hat Linux 8.0 3.2.2-2))

model name  : Pentium III (Coppermine)
stepping        : 1
cpu MHz      : 647.134
cache size     : 256 KB
bogomips      : 1277.95

Cheers,
Sean


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [patch] sched-2.5.64-D3, more interactivity changes
@ 2003-03-19 11:30 Felipe Alfaro Solana
  0 siblings, 0 replies; 11+ messages in thread
From: Felipe Alfaro Solana @ 2003-03-19 11:30 UTC (permalink / raw)
  To: jeremy, akpm; +Cc: mingo, linux-kernel, efault

----- Original Message ----- 
From: Jeremy Fitzhardinge <jeremy@goop.org> 
Date: 	18 Mar 2003 23:13:01 -0800 
To: Andrew Morton <akpm@digeo.com> 
Subject: Re: [patch] sched-2.5.64-D3, more interactivity changes 
 
> I'm still getting starvation problems.  If I run xmms with the "Goom" 
> visualizer (with the window large enough that it is CPU-bound), then 
> type a command into a shell window (say, ps), it will not run the 
> command until I close or shrink the goom window.  xmms itself plays 
> fine, though sometimes it fails to go to the next track, apparently for 
> the same reason (ie, it starts the next track when I disable the 
> visualizer). 
 
Well, I'm also experiencing starvation problems with CPU-bound 
loads. For example, I'm converting all my music collection from 
MP3 to OGG, and when using "oggenc" to convert from WAV to 
OGG, the system becomes pretty unresponsive: running commands 
on a terminal (for example a "ps axf") takes forever, unless you 
stop (Ctrl+S) the "oggenc" process. 
 
To avoid this, I had to lower "oggenc" priority using renice. Using 
renice <PID> +20 helped with starvation :-) 
 
Thanks! 
 
   Felipe 
  
-- 
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [patch] sched-2.5.64-D3, more interactivity changes
@ 2003-03-19 11:40 Felipe Alfaro Solana
  0 siblings, 0 replies; 11+ messages in thread
From: Felipe Alfaro Solana @ 2003-03-19 11:40 UTC (permalink / raw)
  To: efault, jeremy; +Cc: akpm, mingo, linux-kernel

----- Original Message ----- 
From: Mike Galbraith <efault@gmx.de> 
Date: 	Wed, 19 Mar 2003 09:21:00 +0100 
To: Jeremy Fitzhardinge <jeremy@goop.org> 
Subject: Re: [patch] sched-2.5.64-D3, more interactivity changes 
 
> At 11:13 PM 3/18/2003 -0800, Jeremy Fitzhardinge wrote: 
> >I'm still getting starvation problems.  If I run xmms with the "Goom" 
> >visualizer (with the window large enough that it is CPU-bound), then 
> >type a command into a shell window (say, ps), it will not run the 
> >command until I close or shrink the goom window.  xmms itself plays 
> >fine, though sometimes it fails to go to the next track, apparently for 
> >the same reason (ie, it starts the next track when I disable the 
> >visualizer). 
>  
> I'm hot on the trail (woof) of this.  If I get it working "right", are you  
> willing to test a patch?  I don't want to bug Ingo until I've got something  
> worth arm waving about ;-) 
 
I'll do :-) 
 
   Felipe 
 
-- 
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

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

end of thread, other threads:[~2003-03-19 16:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-17 10:21 [patch] sched-2.5.64-D3, more interactivity changes Ingo Molnar
2003-03-17 18:01 ` Martin J. Bligh
2003-03-19  5:52 ` Andrew Morton
2003-03-19  6:31   ` Joshua Kwan
2003-03-19  7:13   ` Jeremy Fitzhardinge
2003-03-19  8:21     ` Mike Galbraith
2003-03-19 16:37       ` Jeremy Fitzhardinge
2003-03-19 16:51       ` Jim Houston
2003-03-18  0:28 Sean Estabrooks
2003-03-19 11:30 Felipe Alfaro Solana
2003-03-19 11:40 Felipe Alfaro Solana

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).