All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Galbraith <mgalbraith@suse.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: zhdxzx@sina.com, linux-kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>, dhillf <dhillf@gmail.com>,
	"hillf.zj" <hillf.zj@alibaba-inc.com>
Subject: Re: sched: how to pick runqueue when checking task hot?
Date: Fri, 06 Jun 2014 13:16:23 +0200	[thread overview]
Message-ID: <1402053383.5859.8.camel@marge.simpson.net> (raw)
In-Reply-To: <20140606101508.GP3213@twins.programming.kicks-ass.net>

On Fri, 2014-06-06 at 12:15 +0200, Peter Zijlstra wrote:

> > --- a/kernel/sched/fair.c	Fri Jun  6 12:37:37 2014
> > +++ b/kernel/sched/fair.c	Fri Jun  6 14:32:34 2014
> > @@ -5051,7 +5051,7 @@ task_hot(struct task_struct *p, u64 now)
> >  	/*
> >  	 * Buddy candidates are cache hot:
> >  	 */
> > -	if (sched_feat(CACHE_HOT_BUDDY) && this_rq()->nr_running &&
> > +	if (sched_feat(CACHE_HOT_BUDDY) && task_rq(p)->nr_running &&
> >  			(&p->se == cfs_rq_of(&p->se)->next ||
> >  			 &p->se == cfs_rq_of(&p->se)->last))
> >  		return 1;
> 
> That does appear to make more sense indeed, seeing how buddies are pairs
> of tasks, so protecting a lone task doesn't make sense.
> 
> 
> Mike, how did you intend this code to work?

IIRC, this_rq()->nr_running was to say if we're idle, we don't care that
it's last/next, pull it.  Not sure I'm the one who did that, but could
be, I didn't look.

-Mike


  reply	other threads:[~2014-06-06 11:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140606065956.854A6718001@webmail.sinamail.sina.com.cn>
2014-06-06 10:15 ` sched: how to pick runqueue when checking task hot? Peter Zijlstra
2014-06-06 11:16   ` Mike Galbraith [this message]
2014-06-06 11:34     ` Peter Zijlstra
2014-06-06 11:50       ` Mike Galbraith

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=1402053383.5859.8.camel@marge.simpson.net \
    --to=mgalbraith@suse.de \
    --cc=dhillf@gmail.com \
    --cc=hillf.zj@alibaba-inc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=zhdxzx@sina.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.