lkml.org 
[lkml]   [2018]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] sched/core: uclamp: add CPU clamp groups accounting
On 13-Apr 10:40, Peter Zijlstra wrote:
> On Mon, Apr 09, 2018 at 05:56:09PM +0100, Patrick Bellasi wrote:
> > +static inline void init_uclamp(void)
>
> WTH is that inline?

You mean I can avoid the attribute?
... or that I should do it in another way?

> > +{
> > + struct uclamp_cpu *uc_cpu;
> > + int clamp_id;
> > + int cpu;
> > +
> > + mutex_init(&uclamp_mutex);
> > +
> > + for (clamp_id = 0; clamp_id < UCLAMP_CNT; ++clamp_id) {
> > + /* Init CPU's clamp groups */
> > + for_each_possible_cpu(cpu) {
> > + uc_cpu = &cpu_rq(cpu)->uclamp[clamp_id];
> > + memset(uc_cpu, UCLAMP_NONE, sizeof(struct uclamp_cpu));
> > + }
> > + }
>
> Those loops are the wrong way around, this shreds your cache. This is a
> slow path so it doesn't much matter, but it is sloppy.

Yess... my bad!... good catch! ;)

>
> > +}

--
#include <best/regards.h>

Patrick Bellasi

\
 
 \ /
  Last update: 2018-04-13 13:18    [W:0.133 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site