lkml.org 
[lkml]   [2007]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectScheduling the highest priority task
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-02 11:03    [W:0.676 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site