Subject: Re: [PATCH v8 3/6] cpufreq: powernv: Remove cpu_to_chip_id() from hot-path

From: Michael Neuling <[email-masked]>
Date: Sat, 19 Mar 2016 10:20:21 +1100

On Sat, 2016-03-19 at 09:37 +1100, Benjamin Herrenschmidt wrote:
> On Fri, 2016-03-18 at 15:04 +1100, Michael Neuling wrote:
> >=20
> >  static int nr_chips;
> > +static DEFINE_PER_CPU(unsigned int, chip_id);
> > =20
> >  /*
> >   * Note: The set of pstates consists of contiguous integers, the
> > @@ -317,9 +318,7 @@ static void powernv_cpufreq_throttle_check(void
> > *data)
> > =20
> >         pmsr =3D get_pmspr(SPRN_PMSR);
> > =20
> > -       for (i =3D 0; i < nr_chips; i++)
> > -               if (chips[i].id =3D=3D cpu_to_chip_id(cpu))
> > -                       break;
> > +       i =3D this_cpu_read(chip_id);
>=20
> Except it's not a chip_id, so your patch confused me for a good 2mn
> ...
> Call it chip_idx maybe ? ie, index.

Yeah, it was a badly named variable but I changed it even more and
Shilpasri rebased it here:

http://patchwork.ozlabs.org/patch/599523/

Mikey