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: <20180413093822.GM4129@hirez.programming.kicks-ass.net>
Date:   Fri, 13 Apr 2018 11:38:22 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Patrick Bellasi <patrick.bellasi@....com>
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>,
        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>,
        Joel Fernandes <joelaf@...gle.com>,
        Steve Muckle <smuckle@...gle.com>
Subject: Re: [PATCH 1/7] sched/core: uclamp: add CPU clamp groups accounting

On Fri, Apr 13, 2018 at 11:30:05AM +0200, Peter Zijlstra wrote:
> On Mon, Apr 09, 2018 at 05:56:09PM +0100, Patrick Bellasi wrote:
> > +struct uclamp_group {
> > +	/* Utilization clamp value for tasks on this clamp group */
> > +	int value;
> > +	/* Number of RUNNABLE tasks on this clamp group */
> > +	int tasks;
> > +};
> 
> > +struct uclamp_cpu {
> > +	/* Utilization clamp value for a CPU */
> > +	int value;
> > +	/* Utilization clamp groups affecting this CPU */
> > +	struct uclamp_group group[CONFIG_UCLAMP_GROUPS_COUNT + 1];
> > +};
> 
> > @@ -811,6 +885,11 @@ struct rq {
> >  	unsigned long		cpu_capacity;
> >  	unsigned long		cpu_capacity_orig;
> >  
> > +#ifdef CONFIG_UCLAMP_TASK
> > +	/* util_{min,max} clamp values based on CPU's active tasks */
> > +	struct uclamp_cpu uclamp[UCLAMP_CNT];
> > +#endif
> > +
> >  	struct callback_head	*balance_callback;
> >  
> >  	unsigned char		idle_balance;
> 
> So that is:
> 
> struct rq {
> 
> 	struct uclamp_cpu {
> 		int value;
> 
> 		/* 4 byte hole */
> 
> 		struct uclamp_group {
> 			int value;
> 			int tasks;
> 		} [COUNT + 1];	// size: COUNT+2 * 8 [bytes]
> 
> 	} [2]; // size: 2 * COUNT+2 * 8 [bytes]
> 
> };

Note that you can slightly compress the data structure if you do
something like:

	struct rq {

		int active_clamp[2];

		struct uclamp_group {
			int value;
			int task;
		} [COUNT + 1][2]; // XXX check array order of C
	};

It also avoids the active values being split over 2 lines; and we need
those values every time, even if there are no active clamp tasks on the
system.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ