From: Peter Zijlstra <peterz@infradead.org>
To: Michael wang <wangyun@linux.vnet.ibm.com>
Cc: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
tglx@linutronix.de, linux-tip-commits@vger.kernel.org
Subject: Re: [tip:sched/core] sched: Push down pre_schedule() and idle_balance ()
Date: Wed, 12 Feb 2014 11:22:51 +0100 [thread overview]
Message-ID: <20140212102251.GD3545@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <52FB1411.1040305@linux.vnet.ibm.com>
On Wed, Feb 12, 2014 at 02:26:25PM +0800, Michael wang wrote:
> Hi, Peter
>
> On 02/11/2014 08:17 PM, tip-bot for Peter Zijlstra wrote:
> [snip]
> > +
> > +idle:
> > +#ifdef CONFIG_SMP
> > + idle_enter_fair(rq);
> > + /*
> > + * We must set idle_stamp _before_ calling idle_balance(), such that we
> > + * measure the duration of idle_balance() as idle time.
> > + */
> > + rq->idle_stamp = rq_clock(rq);
> > + if (idle_balance(rq)) { /* drops rq->lock */
>
> Since idle_balance() will release the rq lock, will it happen that some
> rt or dl tasks was waken up and enqueued before it hold the lock again?
>
> Should we recheck 'rq->nr_running == rq->cfs.h_nr_running' here before
> goto pick fair entity to make sure the priority?
>
> May be like:
>
> if (idle_balance(rq) &&
> rq->nr_running == rq->cfs.h_nr_running)
Yes I think there might be a problem here because of how we re-arranged
things. Let me brew of pot of tea and try to actually wake up.
I suspect we might be good if we clear the need_resched flags before
calling pick_next_task. Then any RT/DL task that gets moved here will
set need resched, and we'll retry the pick_next_task loop.
next prev parent reply other threads:[~2014-02-12 10:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 12:17 [tip:sched/core] sched: Push down pre_schedule() and idle_balance () tip-bot for Peter Zijlstra
2014-02-12 6:26 ` Michael wang
2014-02-12 10:22 ` Peter Zijlstra [this message]
2014-02-13 3:34 ` Michael wang
2014-02-14 2:13 ` Michael wang
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=20140212102251.GD3545@laptop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=wangyun@linux.vnet.ibm.com \
/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.