mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Der Herr Hofrat <der.herr@hofr.at>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.0 schedule_tick question
Date: Sun, 11 Jan 2004 08:57:28 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0401110855420.19685-100000@bigblue.dev.mdolabs.com> (raw)
In-Reply-To: <200401101235.i0ACZUS12298@hofr.at>

On Sat, 10 Jan 2004, Der Herr Hofrat wrote:

>  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 ?

Yes, we could have a rotate_task() function but the impact is basically 
zero because of the little overhead compared to the frequency of the 
operation.



- Davide



  reply	other threads:[~2004-01-11 16:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-10 12:35 Der Herr Hofrat
2004-01-11 16:57 ` Davide Libenzi [this message]
2004-01-10 17:22   ` Der Herr Hofrat
2004-01-11 17:32     ` Davide Libenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0401110855420.19685-100000@bigblue.dev.mdolabs.com \
    --to=davidel@xmailserver.org \
    --cc=der.herr@hofr.at \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®