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

2016-03-19 Thread Michael Neuling
On Fri, 2016-03-18 at 15:04 +1100, Michael Neuling wrote: > On Wed, 2016-02-03 at 01:11 +0530, Shilpasri G Bhat wrote: > > > cpu_to_chip_id() does a DT walk through to find out the chip id by > > taking a contended device tree lock. This adds an unnecessary > > overhead > > in a hot path. So ins

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

2016-03-19 Thread Benjamin Herrenschmidt
On Fri, 2016-03-18 at 15:04 +1100, Michael Neuling wrote: > >  static int nr_chips; > +static DEFINE_PER_CPU(unsigned int, chip_id); >   >  /* >   * Note: The set of pstates consists of contiguous integers, the > @@ -317,9 +318,7 @@ static void powernv_cpufreq_throttle_check(void > *data) >   >   

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

2016-03-18 Thread Michael Neuling
On Wed, 2016-02-03 at 01:11 +0530, Shilpasri G Bhat wrote: > cpu_to_chip_id() does a DT walk through to find out the chip id by > taking a contended device tree lock. This adds an unnecessary overhead > in a hot path. So instead of calling cpu_to_chip_id() everytime cache > the chip ids for all co

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

2016-03-18 Thread Rafael J. Wysocki
On Fri, Mar 18, 2016 at 5:11 AM, Michael Neuling wrote: > On Fri, 2016-03-18 at 15:04 +1100, Michael Neuling wrote: > >> On Wed, 2016-02-03 at 01:11 +0530, Shilpasri G Bhat wrote: >> > >> > cpu_to_chip_id() does a DT walk through to find out the chip id by >> > taking a contended device tree lock.

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

2016-03-18 Thread Michael Neuling
On Sat, 2016-03-19 at 09:37 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2016-03-18 at 15:04 +1100, Michael Neuling wrote: > > > > static int nr_chips; > > +static DEFINE_PER_CPU(unsigned int, chip_id); > > > > /* > > * Note: The set of pstates consists of contiguous integers, the > > @@ -

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

2016-02-02 Thread Shilpasri G Bhat
cpu_to_chip_id() does a DT walk through to find out the chip id by taking a contended device tree lock. This adds an unnecessary overhead in a hot path. So instead of calling cpu_to_chip_id() everytime cache the chip ids for all cores in the array 'core_to_chip_map' and use it in the hotpath. Repo