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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181107145355.GI14309@e110439-lin>
Date:   Wed, 7 Nov 2018 14:53:55 +0000
From:   Patrick Bellasi <patrick.bellasi@....com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
        Ingo Molnar <mingo@...hat.com>, Tejun Heo <tj@...nel.org>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Paul Turner <pjt@...gle.com>,
        Quentin Perret <quentin.perret@....com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Morten Rasmussen <morten.rasmussen@....com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Todd Kjos <tkjos@...gle.com>,
        Joel Fernandes <joelaf@...gle.com>,
        Steve Muckle <smuckle@...gle.com>,
        Suren Baghdasaryan <surenb@...gle.com>
Subject: Re: [PATCH v5 03/15] sched/core: uclamp: map TASK's clamp values
 into CPU's clamp groups

On 07-Nov 15:37, Peter Zijlstra wrote:
> On Mon, Oct 29, 2018 at 06:32:57PM +0000, Patrick Bellasi wrote:
> > +static int __setscheduler_uclamp(struct task_struct *p,
> > +				 const struct sched_attr *attr)
> > +{
> > +	unsigned int lower_bound = p->uclamp[UCLAMP_MIN].value;
> > +	unsigned int upper_bound = p->uclamp[UCLAMP_MAX].value;
> > +	int result = 0;
> > +
> > +	if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MIN)
> > +		lower_bound = attr->sched_util_min;
> > +
> > +	if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MAX)
> > +		upper_bound = attr->sched_util_max;
> > +
> > +	if (lower_bound > upper_bound ||
> > +	    upper_bound > SCHED_CAPACITY_SCALE)
> >  		return -EINVAL;
> >  
> > +	mutex_lock(&uclamp_mutex);
> >  
> > +	/* Update each required clamp group */
> > +	if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MIN) {
> > +		uclamp_group_get(&p->uclamp[UCLAMP_MIN],
> > +				 UCLAMP_MIN, lower_bound);
> > +	}
> > +	if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MAX) {
> > +		uclamp_group_get(&p->uclamp[UCLAMP_MAX],
> > +				 UCLAMP_MAX, upper_bound);
> > +	}
> > +
> > +	mutex_unlock(&uclamp_mutex);
> > +
> > +	return result;
> > +}
> 
> I'm missing where we error due to lack of groups.

Again, after:

   sched/core: uclamp: add clamp group bucketing support

we should never error.

Perhaps I should really squash the bucketing in these first patches
directly... lemme see what's your take on those bits, if you like them
better not in a separate patch, I'll squash them on v6.

-- 
#include <best/regards.h>

Patrick Bellasi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ