From: Der Herr Hofrat <der.herr@hofr.at>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Der Herr Hofrat <der.herr@hofr.at>, linux-kernel@vger.kernel.org
Subject: Re: 2.6.0 schedule_tick question
Date: Sat, 10 Jan 2004 18:22:03 +0100 (CET) [thread overview]
Message-ID: <200401101722.i0AHM3l17594@hofr.at> (raw)
In-Reply-To: <Pine.LNX.4.44.0401110855420.19685-100000@bigblue.dev.mdolabs.com> from Davide Libenzi at "Jan 11, 2004 08:57:28 am"
>
> > 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.
>
ok - well maby someone wants to drop it in any way as its
trivial and actually it would be easier to read if the function name
were rotate_task and not dequeue/enqueu to implement RR behavior.
thx !
hofrat
next prev parent reply other threads:[~2004-01-11 17:23 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
2004-01-10 17:22 ` Der Herr Hofrat [this message]
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=200401101722.i0AHM3l17594@hofr.at \
--to=der.herr@hofr.at \
--cc=davidel@xmailserver.org \
--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®