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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 24 Jan 2018 19:31:38 +0000
From:   Patrick Bellasi <patrick.bellasi@....com>
To:     Pavan Kondeti <pkondeti@...eaurora.org>
Cc:     linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Paul Turner <pjt@...gle.com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Morten Rasmussen <morten.rasmussen@....com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Todd Kjos <tkjos@...roid.com>,
        Joel Fernandes <joelaf@...gle.com>,
        Steve Muckle <smuckle@...gle.com>
Subject: Re: [PATCH v3 2/3] sched/fair: use util_est in LB and WU paths

On 24-Jan 17:03, Pavan Kondeti wrote:
> Hi Patrick,

Hi Pavan,


> On Tue, Jan 23, 2018 at 06:08:46PM +0000, Patrick Bellasi wrote:
> >  static unsigned long cpu_util_wake(int cpu, struct task_struct *p)
> >  {
> > -	unsigned long util, capacity;
> > +	long util, util_est;
> >  
> >  	/* Task has no contribution or is new */
> >  	if (cpu != task_cpu(p) || !p->se.avg.last_update_time)
> > -		return cpu_util(cpu);
> > +		return cpu_util_est(cpu);
> >  
> > -	capacity = capacity_orig_of(cpu);
> > -	util = max_t(long, cpu_rq(cpu)->cfs.avg.util_avg - task_util(p), 0);
> > +	/* Discount task's blocked util from CPU's util */
> > +	util = cpu_util(cpu) - task_util(p);
> > +	util = max(util, 0L);
> >  
> > -	return (util >= capacity) ? capacity : util;
> > +	if (!sched_feat(UTIL_EST))
> > +		return util;
> 
> At first, It is not clear to me why you are not clamping the capacity to
> CPU original capacity. It looks like it is not needed any more with
> commit f453ae2200b0 ("sched/fair: Consider RT/IRQ pressure in
> capacity_spare_wake()") inclusion.

Mainly because the above code now uses only cpu_util() which is already clamped
by capacity_orig_of().

However, you made me notice that in the few lines which follows, where I do:

> > +       /*
> > +        * These are the main cases covered:
> > +        * - if *p is the only task sleeping on this CPU, then:
> > +        *      cpu_util (== task_util) > util_est (== 0)
> > +        *   and thus we return:
> > +        *      cpu_util_wake = (cpu_util - task_util) = 0
> > +        *
> > +        * - if other tasks are SLEEPING on the same CPU, which is just waking
> > +        *   up, then:
> > +        *      cpu_util >= task_util
> > +        *      cpu_util > util_est (== 0)
> > +        *   and thus we discount *p's blocked utilization to return:
> > +        *      cpu_util_wake = (cpu_util - task_util) >= 0
> > +        *
> > +        * - if other tasks are RUNNABLE on that CPU and
> > +        *      util_est > cpu_util
> > +        *   then we use util_est since it returns a more restrictive
> > +        *   estimation of the spare capacity on that CPU, by just considering
> > +        *   the expected utilization of tasks already runnable on that CPU.
> > +        */
> > +       util_est = cpu_rq(cpu)->cfs.util_est_runnable;
> > +       util = max(util, util_est);
> > +
> > +       return util;

I should instead clamp util before returning it! ;-)

> May be a separate patch to remove  the clamping part?

No, I think we should keep cpu_util_wake clamped to not affect the existing
call sites. I just need to remove it where not needed (done) and add it where
needed (will do on the next iteration).

> Thanks,
> Pavan

Cheers Patrick

-- 
#include <best/regards.h>

Patrick Bellasi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ