All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Roehricht <ml@felicis.org>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu
Subject: Scheduling the highest priority task
Date: Thu, 02 Aug 2007 10:58:09 +0200	[thread overview]
Message-ID: <46B19CA1.7050204@felicis.org> (raw)
In-Reply-To: <8KLFD-G9-5@gated-at.bofh.it>

Hi,

perhaps someone can give me a hint what I should consider to look for in 
order to change the ("old" 2.6.21) scheduler such that it schedules the 
highest priority task of a given runqueue.
Given a multiprocessor system I currently observe that whenever there 
are two tasks on one CPU, the lower priority one is migrated to another 
CPU. But I don't realize why this happens. From looking at the source 
code I thought it should be the highest priority one (lowest bit set in 
the runqueue's bitmap) according to
	idx = sched_find_first_bit(array->bitmap);
within move_tasks(). The idx value is then used as an index (surprise) 
to the linked list of tasks of this particular priority and one task is 
picked:
	head = array->queue + idx;
         curr = head->prev;
         tmp = list_entry(curr, struct task_struct, run_list);

Is my assumption wrong? Using printk()s within this code section makes 
the system just hang completely quite soon. The schedstats do not notify 
me immediately. So I am a bit lost on how to track down or trace the 
problem.

Can anybody confirm that my observations are correct that the scheduler 
picks the lowest priority job of a runqueue for migration?
What needs to be changed in order to pick the highest priority one?

Martin

  parent reply	other threads:[~2007-08-02  8:58 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 ` Martin Roehricht [this message]
2007-08-02 11:40   ` Scheduling the highest priority task 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

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=46B19CA1.7050204@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.