mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.6.0 schedule_tick question
@ 2004-01-10 12:35 Der Herr Hofrat
  2004-01-11 16:57 ` Davide Libenzi
  0 siblings, 1 reply; 4+ messages in thread
From: Der Herr Hofrat @ 2004-01-10 12:35 UTC (permalink / raw)
  To: linux-kernel


HI !

 in 2.6.0 kernel/sched.c scheduler_tick currently the 
 case of rt_tasks for SCHED_RR is doing

	if ((p->policy == SCHED_RR) && !--p->time_slice) {
			...
                        dequeue_task(p, rq->active);
                        enqueue_task(p, rq->active);

 which is:

static inline void dequeue_task(struct task_struct *p, prio_array_t *array)
{
        array->nr_active--;
        list_del(&p->run_list);
        if (list_empty(array->queue + p->prio))
                __clear_bit(p->prio, array->bitmap);
}

static inline void enqueue_task(struct task_struct *p, prio_array_t *array)
{
        list_add_tail(&p->run_list, array->queue + p->prio);
        __set_bit(p->prio, array->bitmap);
        array->nr_active++;
        p->array = array;
}

 looking at these two functions this looks like quite some overhead as it
 actually could be reduced to:

        list_del(&p->run_list);
	list_add_tail(&p->run_list, array->queue + p->prio);

 for the rest I don't see any effect it would have ?

hofrat

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

end of thread, other threads:[~2004-01-11 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-10 12:35 2.6.0 schedule_tick question Der Herr Hofrat
2004-01-11 16:57 ` Davide Libenzi
2004-01-10 17:22   ` Der Herr Hofrat
2004-01-11 17:32     ` Davide Libenzi

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

all inboxes | Powered by JetHome®