public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Scheduler RR, first time slice wrong?
@ 2008-11-06  7:22 Andreas Huber
  2008-11-06  7:44 ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Huber @ 2008-11-06  7:22 UTC (permalink / raw)
  To: linux-kernel

Hi,

when starting a real-time process with the round-robin scheduler, the
first time slice is set to HZ (1 second).
When starting two such processes at the same time of the same static
priority, the second one started is first executed after 1 second.
(supposing the first process is heavy on cpu load).
After both have exhausted this first time slice, it is set to
DEF_TIMESLICE (which is 100ms).

Is this behavior as it is supposed to be?

Please add me in CC.

Regards,
Andreas


Relevant parts in the code:
include/linux/init_task.h
#define INIT_TASK(tsk) \
	.rt	= { \
		.time_slice = HZ,

kernel/sched.c
#define DEF_TIMESLICE   (100 * HZ / 1000)

kernel/sched_rt.c
static void task_tick_rt(struct rq *rq, struct task_struct *p, int
queued)
  if (--p->rt.time_slice)
    return;

  p->rt.time_slice = DEF_TIMESLICE;


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

end of thread, other threads:[~2008-11-07 12:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-06  7:22 Scheduler RR, first time slice wrong? Andreas Huber
2008-11-06  7:44 ` Ingo Molnar
2008-11-06  8:46   ` Peter Zijlstra
2008-11-07  9:19     ` Ingo Oeser
2008-11-07 12:31       ` Peter Zijlstra

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