From: Martin Roehricht <ml@felicis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Scheduling the highest priority task
Date: Thu, 02 Aug 2007 23:05:32 +0200 [thread overview]
Message-ID: <46B2471C.5060801@felicis.org> (raw)
In-Reply-To: <20070802194825.GA23245@elte.hu>
On 02.08.2007 21:48, Ingo Molnar wrote:
> * Martin Roehricht <ml@felicis.org> wrote:
>
>> On 08/02/2007 05:19 PM, Ingo Molnar wrote:
>> >* Martin Roehricht <ml@felicis.org> wrote:
>> >
>> >>That's fine with me, that within the same priority-queue any task can
>> >>be chosen. But assume two tasks with highly different priorities, such
>> >>as 105 and 135 are scheduled on the same processor and one of them is
>> >>now to be migrated -- shouldn't be the queue with task P=105
>> >>considered first for migration by this code? Both tasks would use
>> >>different queues with their own linked lists, right?
>> >
>> >yes. What makes you believe that the lower priority one (prio 135) is
>> >chosen? [ as i said before, that will only be chosen if all tasks in the
>> >higher-priority queue (prio 105) are either already running on a CPU or
>> >have recently run so that the cache-hot logic skips them. ]
>>
>> This believe is primarily based on my observations of multiple
>> benchmark runs and also on your statement earlier: »in the SMP
>> migration code, the 'old scheduler' indeed picks the lowest priority
>> one«.
>
> oh, sorry, that was meant to be the 'highest priority one' :-/
>
> so i think you got it all right, i just typoed that first sentence.
Okay, now I think I understood this part of the code correctly. The
reason why I observe a continous migration of the _lower_ priority tasks
is most probably due to the fact that the higher priority one is
currently running, according to:
can_migrate_task() in move_tasks(), and therein:
if (task_running(rq, p))
return 0;
I tracked down via an extended /proc/schedstats that my tasks fall
frequently into this pitfall. I basically solved it by making use of the
more active push-strategy which is called later by load_balance() once
the move_tasks() function did not succeed. So in case I need the higher
priority tasks, I return immediately from move_tasks().
Thanks for your help,
Martin
prev parent reply other threads:[~2007-08-02 21:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8KLFD-G9-5@gated-at.bofh.it>
2007-07-25 15:18 ` highest and lowest priority job of a runqueue Martin Roehricht
2007-08-02 8:58 ` Scheduling the highest priority task Martin Roehricht
2007-08-02 11:40 ` Ingo Molnar
2007-08-02 15:00 ` Martin Roehricht
2007-08-02 15:03 ` Ingo Molnar
2007-08-02 15:14 ` Martin Roehricht
2007-08-02 15:19 ` Ingo Molnar
2007-08-02 15:46 ` Martin Roehricht
2007-08-02 19:48 ` Ingo Molnar
2007-08-02 21:05 ` Martin Roehricht [this message]
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=46B2471C.5060801@felicis.org \
--to=ml@felicis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.