lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 06 Jun 2014 13:50:10 +0200
From:	Mike Galbraith <mgalbraith@...e.de>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	zhdxzx@...a.com, linux-kernel <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...nel.org>, dhillf <dhillf@...il.com>,
	"hillf.zj" <hillf.zj@...baba-inc.com>
Subject: Re: sched: how to pick runqueue when checking task hot?

On Fri, 2014-06-06 at 13:34 +0200, Peter Zijlstra wrote: 
> On Fri, Jun 06, 2014 at 01:16:23PM +0200, Mike Galbraith wrote:
> > 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.
> > 
> 
> commit f685ceacab07d3f6c236f04803e2f2f0dbcc5afb
> Author: Mike Galbraith <efault@....de>
> Date:   Fri Oct 23 23:09:22 2009 +0200
> 
>     sched: Strengthen buddies and mitigate buddy induced latencies
> 
> ...
> 
> -       if (sched_feat(CACHE_HOT_BUDDY) &&
> +       if (sched_feat(CACHE_HOT_BUDDY) && this_rq()->nr_running &&
>                         (&p->se == cfs_rq_of(&p->se)->next ||
>                          &p->se == cfs_rq_of(&p->se)->last))
> 
> Yeah, was you ;-)

    Last hunk prevents buddies from stymieing BALANCE_NEWIDLE via
    CACHE_HOT_BUDDY.

Last hunk, first hunk, whatever, that's what it was for :)

-Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ