From: Mike Galbraith <efault@gmx.de>
To: rostedt@goodmis.org
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>,
Peter Williams <pwil3058@bigpond.net.au>,
LKML <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [patch] f83f9ac causes tasks running at MAX_PRIO
Date: Wed, 02 Dec 2009 17:51:55 +0100 [thread overview]
Message-ID: <1259772715.7052.39.camel@marge.simson.net> (raw)
In-Reply-To: <1259762606.12870.16.camel@gandalf.stny.rr.com>
On Wed, 2009-12-02 at 09:03 -0500, Steven Rostedt wrote:
> On Wed, 2009-12-02 at 12:46 +0100, Peter Zijlstra wrote:
> > Funny thing though, INIT_TASK() sets everything at MAX_PRIO-20.
>
> Right, because the init task will fork. But once a task becomes idle, it
> should never do anything (but service interrupts).
Seems it forks _as_ the idle thread..
/*
* Make us the idle thread. Technically, schedule() should not be
* called from this thread, however somewhere below it might be,
* but because we are the idle thread, we just pick up running again
* when this runqueue becomes "idle".
*/
init_idle(current, smp_processor_id());
calc_load_update = jiffies + LOAD_FREQ;
/*
* During early bootup we pretend to be a normal task:
*/
current->sched_class = &fair_sched_class;
..init task becomes the idle thread in sched_init().. gets to
rest_init(), forks with prio and normal_prio now at MAX_PRIO, but
static_prio still at NICE_0.
Peter's change looks OK unless I'm missing something. Though...
static void pull_task(struct rq *src_rq, struct task_struct *p,
struct rq *this_rq, int this_cpu)
{
deactivate_task(src_rq, p, 0);
set_task_cpu(p, this_cpu);
activate_task(this_rq, p, 0);
/*
* Note that idle threads have a prio of MAX_PRIO, for this test
* to be always true for them.
*/
check_preempt_curr(this_rq, p, 0);
}
..we have some O(1) comments for future generations to ponder.
-Mike
next prev parent reply other threads:[~2009-12-02 16:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-29 13:23 [patch] f83f9ac causes tasks running at MAX_PRIO Mike Galbraith
2009-12-02 11:46 ` Peter Zijlstra
2009-12-02 12:49 ` Mike Galbraith
2009-12-03 1:25 ` Peter Williams
2009-12-03 1:44 ` Mike Galbraith
2009-12-03 10:02 ` Peter Zijlstra
2009-12-02 14:03 ` Steven Rostedt
2009-12-02 16:51 ` Mike Galbraith [this message]
2009-12-09 9:55 ` [tip:sched/urgent] sched: Fix task priority bug tip-bot for Peter Zijlstra
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=1259772715.7052.39.camel@marge.simson.net \
--to=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=pwil3058@bigpond.net.au \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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