On Thu, Mar 14, 2019 at 03:07:53PM +, Patrick Bellasi wrote:
> On 14-Mar 14:32, Peter Zijlstra wrote:
> > On Thu, Mar 14, 2019 at 12:13:15PM +, Patrick Bellasi wrote:
> > > > I'd be most impressed if they pull this off. Check the generated code
> > > > and see I suppose :-)
> > >
> > > On
On Thu, Mar 14, 2019 at 8:41 AM Patrick Bellasi wrote:
>
> On 14-Mar 08:29, Suren Baghdasaryan wrote:
> > On Thu, Mar 14, 2019 at 7:46 AM Patrick Bellasi
> > wrote:
> > > On 13-Mar 14:32, Suren Baghdasaryan wrote:
> > > > On Fri, Feb 8, 2019 at 2:06 AM Patrick Bellasi
> > > > wrote:
>
> [...]
On 14-Mar 08:29, Suren Baghdasaryan wrote:
> On Thu, Mar 14, 2019 at 7:46 AM Patrick Bellasi
> wrote:
> > On 13-Mar 14:32, Suren Baghdasaryan wrote:
> > > On Fri, Feb 8, 2019 at 2:06 AM Patrick Bellasi
> > > wrote:
[...]
> > > > The rq::uclamp::bucket[clamp_id][] array is scanned every time
On Thu, Mar 14, 2019 at 7:46 AM Patrick Bellasi wrote:
>
> On 13-Mar 14:32, Suren Baghdasaryan wrote:
> > On Fri, Feb 8, 2019 at 2:06 AM Patrick Bellasi
> > wrote:
> > >
> > > Utilization clamping allows to clamp the CPU's utilization within a
> > > [util_min, util_max] range, depending on the
On 14-Mar 14:32, Peter Zijlstra wrote:
> On Thu, Mar 14, 2019 at 12:13:15PM +, Patrick Bellasi wrote:
> > > I'd be most impressed if they pull this off. Check the generated code
> > > and see I suppose :-)
> >
> > On x86 the code generated looks exactly the same:
> >
> >
On 13-Mar 15:15, Patrick Bellasi wrote:
> On 12-Mar 13:52, Dietmar Eggemann wrote:
> > On 2/8/19 11:05 AM, Patrick Bellasi wrote:
[...]
> > > + * within each bucket the exact "requested" clamp value whenever all
> > > tasks
> > > + * RUNNABLE in that bucket require the same clamp.
> > > + */
>
On 13-Mar 14:01, Suren Baghdasaryan wrote:
> On Wed, Mar 13, 2019 at 8:15 AM Patrick Bellasi
> wrote:
> >
> > On 12-Mar 13:52, Dietmar Eggemann wrote:
> > > On 2/8/19 11:05 AM, Patrick Bellasi wrote:
[...]
> > > > +static inline unsigned int uclamp_bucket_value(unsigned int
> > > >
On 13-Mar 14:32, Suren Baghdasaryan wrote:
> On Fri, Feb 8, 2019 at 2:06 AM Patrick Bellasi
> wrote:
> >
> > Utilization clamping allows to clamp the CPU's utilization within a
> > [util_min, util_max] range, depending on the set of RUNNABLE tasks on
> > that CPU. Each task references two "clamp
On Thu, Mar 14, 2019 at 12:13:15PM +, Patrick Bellasi wrote:
> > I'd be most impressed if they pull this off. Check the generated code
> > and see I suppose :-)
>
> On x86 the code generated looks exactly the same:
>
>https://godbolt.org/z/PjmA7k
Argh, they do mult by inverse to avoid
On Thu, Mar 14, 2019 at 11:03:30AM +, Patrick Bellasi wrote:
> void uclamp_rq_dec_id(struct rq *rq, int clamp_id, int bucket_id) {
> if (__builtin_expect(!!(rq->uclamp[clamp_id].bucket[bucket_id].tasks), 1))
> return;
> rq->uclamp[clamp_id].bucket[bucket_id].tasks--;
> }
>
On 13-Mar 14:23, Suren Baghdasaryan wrote:
> On Wed, Mar 13, 2019 at 6:52 AM Peter Zijlstra wrote:
> >
> > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > > +/*
> > > + * When a task is enqueued on a rq, the clamp bucket currently defined
> > > by the
> > > + * task's
On 13-Mar 14:08, Suren Baghdasaryan wrote:
> On Wed, Mar 13, 2019 at 12:46 PM Peter Zijlstra wrote:
> >
> > On Wed, Mar 13, 2019 at 03:23:59PM +, Patrick Bellasi wrote:
> > > On 13-Mar 15:09, Peter Zijlstra wrote:
> > > > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> >
>
On 13-Mar 20:48, Peter Zijlstra wrote:
> On Wed, Mar 13, 2019 at 04:12:29PM +, Patrick Bellasi wrote:
> > On 13-Mar 14:40, Peter Zijlstra wrote:
> > > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > > > +static inline unsigned int uclamp_bucket_id(unsigned int clamp_value)
On 13-Mar 20:46, Peter Zijlstra wrote:
> On Wed, Mar 13, 2019 at 03:23:59PM +, Patrick Bellasi wrote:
> > On 13-Mar 15:09, Peter Zijlstra wrote:
> > > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
>
> > > > +static inline void uclamp_rq_update(struct rq *rq, unsigned int
>
On 13-Mar 20:39, Peter Zijlstra wrote:
> On Wed, Mar 13, 2019 at 03:59:54PM +, Patrick Bellasi wrote:
> > On 13-Mar 14:52, Peter Zijlstra wrote:
>
> > Because of backetization, we potentially end up tracking tasks with
> > different requested clamp values in the same bucket.
> >
> > For
On 13-Mar 20:30, Peter Zijlstra wrote:
> On Wed, Mar 13, 2019 at 03:59:54PM +, Patrick Bellasi wrote:
> > On 13-Mar 14:52, Peter Zijlstra wrote:
> > > > +static inline void uclamp_rq_dec_id(struct task_struct *p, struct rq
> > > > *rq,
> > > > + unsigned int
On Fri, Feb 8, 2019 at 2:06 AM Patrick Bellasi wrote:
>
> Utilization clamping allows to clamp the CPU's utilization within a
> [util_min, util_max] range, depending on the set of RUNNABLE tasks on
> that CPU. Each task references two "clamp buckets" defining its minimum
> and maximum
On Wed, Mar 13, 2019 at 6:52 AM Peter Zijlstra wrote:
>
> On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > +/*
> > + * When a task is enqueued on a rq, the clamp bucket currently defined by
> > the
> > + * task's uclamp::bucket_id is reference counted on that rq. This also
>
On Wed, Mar 13, 2019 at 12:46 PM Peter Zijlstra wrote:
>
> On Wed, Mar 13, 2019 at 03:23:59PM +, Patrick Bellasi wrote:
> > On 13-Mar 15:09, Peter Zijlstra wrote:
> > > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
>
> > > > +static inline void uclamp_rq_update(struct rq
On Wed, Mar 13, 2019 at 8:15 AM Patrick Bellasi wrote:
>
> On 12-Mar 13:52, Dietmar Eggemann wrote:
> > On 2/8/19 11:05 AM, Patrick Bellasi wrote:
> >
> > [...]
> >
> > > +config UCLAMP_BUCKETS_COUNT
> > > + int "Number of supported utilization clamp buckets"
> > > + range 5 20
> > > +
On Wed, Mar 13, 2019 at 04:12:29PM +, Patrick Bellasi wrote:
> On 13-Mar 14:40, Peter Zijlstra wrote:
> > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > > +static inline unsigned int uclamp_bucket_id(unsigned int clamp_value)
> > > +{
> > > + return clamp_value /
On Wed, Mar 13, 2019 at 03:23:59PM +, Patrick Bellasi wrote:
> On 13-Mar 15:09, Peter Zijlstra wrote:
> > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > > +static inline void uclamp_rq_update(struct rq *rq, unsigned int clamp_id)
> > > +{
> > > + struct uclamp_bucket
On Wed, Mar 13, 2019 at 03:59:54PM +, Patrick Bellasi wrote:
> On 13-Mar 14:52, Peter Zijlstra wrote:
> Because of backetization, we potentially end up tracking tasks with
> different requested clamp values in the same bucket.
>
> For example, with 20% bucket size, we can have:
> Task1:
On Wed, Mar 13, 2019 at 03:59:54PM +, Patrick Bellasi wrote:
> On 13-Mar 14:52, Peter Zijlstra wrote:
> > > +static inline void uclamp_rq_dec_id(struct task_struct *p, struct rq *rq,
> > > + unsigned int clamp_id)
> > > +{
> > > + unsigned int bucket_id =
On 13-Mar 18:22, Peter Zijlstra wrote:
> On Wed, Mar 13, 2019 at 04:12:29PM +, Patrick Bellasi wrote:
> > Yes, the for looks better, but perhaps like that:
> >
> > unsigned int bucket_id = UCLAMP_BUCKETS;
> >
> > /*
> > * Both min and max clamps are MAX aggregated, thus the
On Wed, Mar 13, 2019 at 04:12:29PM +, Patrick Bellasi wrote:
> Yes, the for looks better, but perhaps like that:
>
> unsigned int bucket_id = UCLAMP_BUCKETS;
>
> /*
>* Both min and max clamps are MAX aggregated, thus the topmost
>* bucket with some tasks defines
On 13-Mar 14:40, Peter Zijlstra wrote:
> On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > +static inline unsigned int uclamp_bucket_id(unsigned int clamp_value)
> > +{
> > + return clamp_value / UCLAMP_BUCKET_DELTA;
> > +}
> > +
> > +static inline unsigned int
On 13-Mar 14:52, Peter Zijlstra wrote:
> On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > +/*
> > + * When a task is enqueued on a rq, the clamp bucket currently defined by
> > the
> > + * task's uclamp::bucket_id is reference counted on that rq. This also
> > + * immediately
On 13-Mar 15:06, Peter Zijlstra wrote:
> On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > +static void __init init_uclamp(void)
> > +{
> > + unsigned int clamp_id;
> > + int cpu;
> > +
> > + for_each_possible_cpu(cpu)
> > + memset(_rq(cpu)->uclamp, 0,
On 13-Mar 15:09, Peter Zijlstra wrote:
> On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > +static inline unsigned int uclamp_none(int clamp_id)
> > +{
> > + if (clamp_id == UCLAMP_MIN)
> > + return 0;
> > + return SCHED_CAPACITY_SCALE;
> > +}
> > +
> > +static
On 12-Mar 13:52, Dietmar Eggemann wrote:
> On 2/8/19 11:05 AM, Patrick Bellasi wrote:
>
> [...]
>
> > +config UCLAMP_BUCKETS_COUNT
> > + int "Number of supported utilization clamp buckets"
> > + range 5 20
> > + default 5
> > + depends on UCLAMP_TASK
> > + help
> > + Defines the
On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> +static inline unsigned int uclamp_none(int clamp_id)
> +{
> + if (clamp_id == UCLAMP_MIN)
> + return 0;
> + return SCHED_CAPACITY_SCALE;
> +}
> +
> +static inline void uclamp_rq_update(struct rq *rq, unsigned
On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> +static void __init init_uclamp(void)
> +{
> + unsigned int clamp_id;
> + int cpu;
> +
> + for_each_possible_cpu(cpu)
> + memset(_rq(cpu)->uclamp, 0, sizeof(struct uclamp_rq));
> +
Is that really needed?
On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> +/*
> + * When a task is enqueued on a rq, the clamp bucket currently defined by the
> + * task's uclamp::bucket_id is reference counted on that rq. This also
> + * immediately updates the rq's clamp value if required.
> + *
> + *
On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> +static inline unsigned int uclamp_bucket_id(unsigned int clamp_value)
> +{
> + return clamp_value / UCLAMP_BUCKET_DELTA;
> +}
> +
> +static inline unsigned int uclamp_bucket_value(unsigned int clamp_value)
> +{
> + return
On 13-Mar 09:19, Peter Zijlstra wrote:
> On Tue, Mar 12, 2019 at 03:50:43PM +, Patrick Bellasi wrote:
> > On 12-Mar 16:20, Peter Zijlstra wrote:
> > > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > > > +/* Integer ceil-rounded range for each bucket */
>
>
On Tue, Mar 12, 2019 at 03:50:43PM +, Patrick Bellasi wrote:
> On 12-Mar 16:20, Peter Zijlstra wrote:
> > On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > > +/* Integer ceil-rounded range for each bucket */
^^^
> > > +#define
On 12-Mar 16:20, Peter Zijlstra wrote:
> On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> > +/* Integer ceil-rounded range for each bucket */
> > +#define UCLAMP_BUCKET_DELTA ((SCHED_CAPACITY_SCALE / UCLAMP_BUCKETS) + 1)
>
> Uhm, should that not me ((x+y-1)/y), aka.
On Fri, Feb 08, 2019 at 10:05:40AM +, Patrick Bellasi wrote:
> +/* Integer ceil-rounded range for each bucket */
> +#define UCLAMP_BUCKET_DELTA ((SCHED_CAPACITY_SCALE / UCLAMP_BUCKETS) + 1)
Uhm, should that not me ((x+y-1)/y), aka. DIV_ROUND_UP(x,y) ?
The above would give 4 for 9/3, which is
On 2/8/19 11:05 AM, Patrick Bellasi wrote:
[...]
+config UCLAMP_BUCKETS_COUNT
+ int "Number of supported utilization clamp buckets"
+ range 5 20
+ default 5
+ depends on UCLAMP_TASK
+ help
+ Defines the number of clamp buckets to use. The range of each
Utilization clamping allows to clamp the CPU's utilization within a
[util_min, util_max] range, depending on the set of RUNNABLE tasks on
that CPU. Each task references two "clamp buckets" defining its minimum
and maximum (util_{min,max}) utilization "clamp values". A CPU's clamp
bucket is active
41 matches
Mail list logo