From: Martin Roehricht <ml@felicis.org>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu
Subject: Re: highest and lowest priority job of a runqueue
Date: Wed, 25 Jul 2007 17:18:26 +0200 [thread overview]
Message-ID: <46A769C2.6030701@felicis.org> (raw)
In-Reply-To: <8KLFD-G9-5@gated-at.bofh.it>
On 07/25/2007 11:50 AM, Martin Roehricht wrote:
> I thought I might use (given a list with tmp pointers to all CPUs)
> rq = cpu_rq(tmp->cpu);
> task_load = rq->curr->load_weight;
> but this always returns 128 regardless of the fact if a task currently
> runs on that CPU or not. I guess it returns the load of the migration
> thread, but I'm not sure. I would like to migrate specific tasks
> throughout find_busiest_group().
Okay, I think I found that my assumption should be just fine and I had
trouble with some debugging output via the show_schedstat() function.
The "rq->curr->load_weight" returns what it is supposed to return. :-)
I am still uncertain on how to resolve the specific highest or lowest
priority job:
> I was wondering how I may retrieve
> (a) the priority/load of the highest and the lowest priority task of a
> runqueue (in a multiprocessor system), and
> (b) the corresponding pointer to this task?
I will try something of the form (pseudocode like):
int idx;
struct list_head *head;
struct task_struct *task;
idx = sched_find_first_bit(rq->active->bitmap);
head = array->queue + idx;
task = list_entry(head, struct task_struct, run_list);
For the lowest priority task a function like "sched_find_last_bit()"
might be useful.
Would this be a good way to succeed?
> Furthermore, is it correct, that the current migration strategy
> (move_tasks()) chooses automatically the highest priority task?
Thanks,
Martin
next parent reply other threads:[~2007-07-25 15:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8KLFD-G9-5@gated-at.bofh.it>
2007-07-25 15:18 ` Martin Roehricht [this message]
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
2007-07-25 9:48 highest and lowest priority job of a runqueue 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=46A769C2.6030701@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox