[PATCH v9 0/3] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-10-01 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the ninth iteration of the patchset to add support for big-core on POWER9. This patch also optimizes the task placement on such big-core systems. The previous versions can be found here: v8: https://lkml.org/lkml/2018/9/20/899 v7: https://lkm

[PATCH v9 1/3] powerpc: Detect the presence of big-cores via "ibm, thread-groups"

2018-10-01 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On IBM POWER9, the device tree exposes a property array identifed by "ibm,thread-groups" which will indicate which groups of threads share a particular set of resources. As of today we only have one form of grouping identifying the group of thre

[PATCH v9 3/3] powerpc/sysfs: Add topology/smallcore_thread_siblings[_list]

2018-10-01 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" This patch adds two sysfs attributes named smallcore_thread_siblings and smallcore_thread_siblings_list to the "topology" attribute group for each CPU device. The read-only attributes /sys/device/system/cpu/cpuN/topology/smallcore_thread_siblings an

Re: [PATCH v9 0/3] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-10-03 Thread Gautham R Shenoy
Hello Dave, On Mon, Oct 01, 2018 at 07:05:11AM -0700, Dave Hansen wrote: > On 10/01/2018 06:16 AM, Gautham R. Shenoy wrote: > > > > Patch 3: Creates a pair of sysfs attributes named > > /sys/devices/system/cpu/cpuN/topology/smallcore_thread_siblings > >

[PATCH v10 1/3] powerpc: Detect the presence of big-cores via "ibm, thread-groups"

2018-10-10 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On IBM POWER9, the device tree exposes a property array identifed by "ibm,thread-groups" which will indicate which groups of threads share a particular set of resources. As of today we only have one form of grouping identifying the group of thre

[PATCH v10 2/3] powerpc: Use cpu_smallcore_sibling_mask at SMT level on bigcores

2018-10-10 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" POWER9 SMT8 cores consist of two groups of threads, where threads in each group shares L1-cache. The scheduler is not aware of this distinction as the current sched-domain hierarchy has all the threads of the core defined at the SMT domain. SM

[PATCH v10 0/3] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-10-10 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the tenth iteration of the patchset to add support for big-core on POWER9. This patch also optimizes the task placement on such big-core systems. The previous versions can be found here: v9: https://lkml.org/lkml/2018/10/1/608 v8: https://lkm

[PATCH v10 3/3] powerpc/cacheinfo: Report the correct shared_cpu_map on big-cores

2018-10-10 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently on POWER9 SMT8 cores systems, in sysfs, we report the shared_cache_map for L1 caches (both data and instruction) to be the cpu-ids of the threads in SMT8 cores. This is incorrect since on POWER9 SMT8 cores there are two groups of threads, each of wh

Re: [PATCH] cpufreq: powernv: add of_node_put()

2018-11-26 Thread Gautham R Shenoy
Hello Yangtao Li, On Tue, Nov 20, 2018 at 07:57:31AM -0500, Yangtao Li wrote: > use of_node_put() to release the refcount. > Thanks for the patch. Reviewed-by: Gautham R. Shenoy > Signed-off-by: Yangtao Li > --- > drivers/cpufreq/powernv-cpufreq.c | 17 +++-- &g

[PATCH] pseries/hotplug: Add more delay in pseries_cpu_die while waiting for rtas-stop

2018-12-06 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently running DLPAR offline/online operations in a loop on a POWER9 system with SMT=off results in the following crash: [ 223.321032] cpu 112 (hwid 112) Ready to die... [ 223.355963] Querying DEAD? cpu 113 (113) shows 2 [ 223.356233] cpu 114 (hwid 114

Re: [PATCH] pseries/hotplug: Add more delay in pseries_cpu_die while waiting for rtas-stop

2018-12-07 Thread Gautham R Shenoy
Hi Thiago, On Thu, Dec 06, 2018 at 03:28:17PM -0200, Thiago Jung Bauermann wrote: [..snip..] > > > I posted a similar patch last year, but I wasn't able to arrive at a > root cause analysis like you did: > > https://lists.ozlabs.org/pipermail/linuxppc-dev/2017-February/153734.html Ah! Nice.

Re: [PATCH] pseries/hotplug: Add more delay in pseries_cpu_die while waiting for rtas-stop

2018-12-07 Thread Gautham R Shenoy
On Fri, Dec 07, 2018 at 04:13:11PM +0530, Gautham R Shenoy wrote: > Hi Thiago, > > > Sure. I will test the patch and report back. I added the following debug patch on top of your patch, and after an hour's run, the system crashed. Appending the log at the end. I suppose

Re: [PATCH 1/2] powerpc: Detect the presence of big-core with interleaved threads

2018-05-21 Thread Gautham R Shenoy
Hello Michael, On Fri, May 18, 2018 at 11:14:04PM +1000, Michael Ellerman wrote: > Gautham R Shenoy writes: > ... > >> > @@ -565,7 +615,16 @@ void __init smp_setup_cpu_maps(void) > >> > vdso_data->processorCount = num_present_cpus(

Re: [PATCH 1/2] powerpc: Detect the presence of big-core with interleaved threads

2018-05-21 Thread Gautham R Shenoy
Hello Michael, On Fri, May 18, 2018 at 11:21:22PM +1000, Michael Ellerman wrote: > "Gautham R. Shenoy" writes: > > > diff --git a/arch/powerpc/kernel/setup-common.c > > b/arch/powerpc/kernel/setup-common.c > > index 0af5c11..884dff2 100644 > > --- a/arch

[PATCH] cpuidle:powernv: Make the snooze timeout dynamic.

2018-05-31 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" The commit 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state") introduced a timeout for the snooze idle state so that it could be eventually be promoted to a deeper idle state. The snooze timeout value is static a

Re: [PATCH] cpuidle:powernv: Make the snooze timeout dynamic.

2018-05-31 Thread Gautham R Shenoy
Hi Balbir, Thanks for reviewing the patch! On Fri, Jun 01, 2018 at 12:51:05AM +1000, Balbir Singh wrote: > On Thu, May 31, 2018 at 10:15 PM, Gautham R. Shenoy [..snip..] > > > > +static u64 get_snooze_timeout(struct cpuidle_device *dev, > > +

Re: [PATCH] cpuidle:powernv: Make the snooze timeout dynamic.

2018-06-05 Thread Gautham R Shenoy
Hello Michael, On Mon, Jun 04, 2018 at 09:27:40PM +1000, Michael Ellerman wrote: > "Gautham R. Shenoy" writes: > > > From: "Gautham R. Shenoy" > > > > The commit 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of > > snooze to

Re: [PATCH 1/3] powernv/cpuidle: Parse dt idle properties into global structure

2018-06-19 Thread Gautham R Shenoy
Hi Akshay, On Tue, Jun 19, 2018 at 10:34:26AM +0530, Akshay Adiga wrote: > Device-tree parsing happens in twice, once while deciding idle state to > be used for hotplug and once during cpuidle init. Hence, parsing the > device tree and caching it will reduce code duplication. Parsing code > has be

Re: [PATCH 2/3] cpuidle/powernv: Change platform init to avoid reparsing dt

2018-06-19 Thread Gautham R Shenoy
Hi Akshay, On Tue, Jun 19, 2018 at 10:34:27AM +0530, Akshay Adiga wrote: > The required data is accessible from cpuidle_states structure and > nr_cpu_idle_states. This patch makes changes to avoid reparsing and use > data from these structures. > > Signed-off-by: Akshay Adiga > --- > arch/powe

Re: [PATCH 3/3] powernv/cpuidle: Use parsed device tree values for cpuidle_init

2018-06-19 Thread Gautham R Shenoy
Hi Akshay, On Tue, Jun 19, 2018 at 10:34:28AM +0530, Akshay Adiga wrote: > Export pnv_idle_states and nr_pnv_idle_states so that its accessible to > cpuidle driver. Use properties from pnv_idle_states structure for powernv > cpuidle_init. > > Signed-off-by: Akshay Adiga > --- > arch/powerpc/inc

Re: [PATCH v3 1/2] powernv/cpuidle: Parse dt idle properties into global structure

2018-07-03 Thread Gautham R Shenoy
has been > moved to pnv_parse_cpuidle_dt() from pnv_probe_idle_states(). In addition > to the properties in the device tree the number of available states is > also required. > > Signed-off-by: Akshay Adiga > Reviewed-by: Nicholas Piggin Looks good. Reviewed-by: Gautham R. Shenoy

Re: [PATCH v3 2/2] powernv/cpuidle: Use parsed device tree values for cpuidle_init

2018-07-03 Thread Gautham R Shenoy
g the residency values in the kernel. Otherwise looks good to me. Reviewed-by: Gautham R. Shenoy -- Thanks and Regards gautham.

[v2 PATCH 2/2] powerpc: Enable CPU_FTR_ASYM_SMT for interleaved big-cores

2018-07-03 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" A pair of IBM POWER9 SMT4 cores can be fused together to form a big-core with 8 SMT threads. This can be discovered via the "ibm,thread-groups" CPU property in the device tree which will indicate which group of threads that share the L1 cache, t

[v2 PATCH 0/2] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-07-03 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the second iteration of the patchset to add support for big-core on POWER9. The earlier version can be found here: https://lkml.org/lkml/2018/5/11/245. The changes from the previous version: - Added comments explaining the "ibm,thread

[v2 PATCH 1/2] powerpc: Detect the presence of big-cores via "ibm, thread-groups"

2018-07-03 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On IBM POWER9, the device tree exposes a property array identifed by "ibm,thread-groups" which will indicate which groups of threads share a particular set of resources. As of today we only have one form of grouping identifying the group of thre

Re: [v2 PATCH 2/2] powerpc: Enable CPU_FTR_ASYM_SMT for interleaved big-cores

2018-07-04 Thread Gautham R Shenoy
Hi Murilo, Thanks for the review. On Tue, Jul 03, 2018 at 02:53:46PM -0300, Murilo Opsfelder Araujo wrote: [..snip..] > > -/* Initialize CPU <=> thread mapping/ > > + if (has_interleaved_big_core) { > > + int key = __builtin_ctzl(CPU_FTR_ASYM_SMT); > > + > > + cur_c

Re: [v2 PATCH 1/2] powerpc: Detect the presence of big-cores via "ibm, thread-groups"

2018-07-04 Thread Gautham R Shenoy
Hello Murilo, Thanks for reviewing the patch. Replies inline. On Tue, Jul 03, 2018 at 02:16:55PM -0300, Murilo Opsfelder Araujo wrote: > On Tue, Jul 03, 2018 at 04:33:50PM +0530, Gautham R. Shenoy wrote: > > From: "Gautham R. Shenoy" > > > > On IBM POWER9, the

[PATCH v3 0/2] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-07-06 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the third iteration of the patchset to add support for big-core on POWER9. The previous versions can be found here: v2: https://lkml.org/lkml/2018/7/3/401 v1: https://lkml.org/lkml/2018/5/11/245 Changes : v2 --> v3 - Set sane val

[PATCH v3 2/2] powerpc: Enable CPU_FTR_ASYM_SMT for interleaved big-cores

2018-07-06 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" A pair of IBM POWER9 SMT4 cores can be fused together to form a big-core with 8 SMT threads. This can be discovered via the "ibm,thread-groups" CPU property in the device tree which will indicate which group of threads that share the L1 cache, t

[PATCH v3 1/2] powerpc: Detect the presence of big-cores via "ibm, thread-groups"

2018-07-06 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On IBM POWER9, the device tree exposes a property array identifed by "ibm,thread-groups" which will indicate which groups of threads share a particular set of resources. As of today we only have one form of grouping identifying the group of thre

Re: [RFC PATCH] powerpc/64s: Move ISAv3.0 / POWER9 idle code to powernv C code

2018-07-10 Thread Gautham R Shenoy
Hello Nicholas, On Mon, Jul 09, 2018 at 12:24:36AM +1000, Nicholas Piggin wrote: > Reimplement POWER9 idle code in C, in the powernv platform code. > Assembly stubs are used to save and restore the stack frame and > non-volatile GPRs before going to idle, but these are small and > mostly agnostic

Re: [PATCH v3 1/2] powerpc: Detect the presence of big-cores via "ibm, thread-groups"

2018-07-11 Thread Gautham R Shenoy
Hello Murilo, On Sun, Jul 08, 2018 at 01:03:34PM -0300, Murilo Opsfelder Araujo wrote: > On Fri, Jul 06, 2018 at 02:35:48PM +0530, Gautham R. Shenoy wrote: > > From: "Gautham R. Shenoy" > > > > On IBM POWER9, the device tree exposes a property array identifed b

Re: [RFC PATCH] powerpc/64s: Move ISAv3.0 / POWER9 idle code to powernv C code

2018-07-11 Thread Gautham R Shenoy
On Wed, Jul 11, 2018 at 06:30:36PM +1000, Nicholas Piggin wrote: > On Tue, 10 Jul 2018 16:36:34 +0530 > Gautham R Shenoy wrote: > > > Hello Nicholas, > > > > > > On Mon, Jul 09, 2018 at 12:24:36AM +1000, Nicholas Piggin wrote: > > > Reimplement POWE

Re: [PATCH v3 2/2] powerpc: Enable CPU_FTR_ASYM_SMT for interleaved big-cores

2018-07-15 Thread Gautham R Shenoy
rong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Gautham-R-Shenoy/powerpc-Detect-the-presence-of-big-cores-via-ibm-thread-groups/20180706-174756 > base: https://git.kernel.org/pub/scm/linux/kernel/git/powe

[PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-17 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On 64-bit Servers, SPRN_SPRG3 and its userspace read-only mirror SPRN_USPRG3 are used as userspace VDSO write and read registers respectively. SPRN_SPRG3 is lost when we enter stop4 and above, and is currently not restored. As a result, any read from S

Re: [PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-17 Thread Gautham R Shenoy
On Tue, Jul 17, 2018 at 04:57:29PM +0530, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" > > On 64-bit Servers, SPRN_SPRG3 and its userspace read-only mirror > SPRN_USPRG3 are used as userspace VDSO write and read registers > respectively. > > SPRN_SPRG3

[RESEND][PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-17 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On 64-bit servers, SPRN_SPRG3 and its userspace read-only mirror SPRN_USPRG3 are used as userspace VDSO write and read registers respectively. SPRN_SPRG3 is lost when we enter stop4 and above, and is currently not restored. As a result, any read from S

Re: [RESEND][PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-18 Thread Gautham R Shenoy
Hello Mikey, On Wed, Jul 18, 2018 at 09:24:19AM +1000, Michael Neuling wrote: > > > DEFINE(PPC_DBELL_SERVER, PPC_DBELL_SERVER); > > diff --git a/arch/powerpc/kernel/idle_book3s.S > > b/arch/powerpc/kernel/idle_book3s.S > > index d85d551..5069d42 100644 > > --- a/arch/powerpc/kernel/idle_book3

[PATCH v2] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-18 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On 64-bit servers, SPRN_SPRG3 and its userspace read-only mirror SPRN_USPRG3 are used as userspace VDSO write and read registers respectively. SPRN_SPRG3 is lost when we enter stop4 and above, and is currently not restored. As a result, any read from S

[PATCH v4 0/2] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-07-23 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the fourth iteration of the patchset to add support for big-core on POWER9. The previous versions can be found here: v3: https://lkml.org/lkml/2018/7/6/255 v2: https://lkml.org/lkml/2018/7/3/401 v1: https://lkml.org/lkml/2018/5/11/245 Changes :

[PATCH v4 1/2] powerpc: Detect the presence of big-cores via "ibm, thread-groups"

2018-07-23 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On IBM POWER9, the device tree exposes a property array identifed by "ibm,thread-groups" which will indicate which groups of threads share a particular set of resources. As of today we only have one form of grouping identifying the group of thre

[PATCH v4 2/2] powerpc: Enable CPU_FTR_ASYM_SMT for interleaved big-cores

2018-07-23 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" A pair of IBM POWER9 SMT4 cores can be fused together to form a big-core with 8 SMT threads. This can be discovered via the "ibm,thread-groups" CPU property in the device tree which will indicate which group of threads that share the L1 cache, t

Re: [RFC PATCH v2] powerpc/64s: Move idle code to powernv C code

2018-07-25 Thread Gautham R Shenoy
Hello Nicholas, On Sat, Jul 21, 2018 at 02:29:24PM +1000, Nicholas Piggin wrote: > Reimplement Book3S idle code to C, in the powernv platform code. > Assembly stubs are used to save and restore the stack frame and > non-volatile GPRs before going to idle, but these are small and > mostly agnostic

Re: [PATCH v5 2/5] powernv:stop: Uniformly rename power9 to arch300

2017-01-12 Thread Gautham R Shenoy
On Thu, Jan 12, 2017 at 03:17:33PM +0530, Balbir Singh wrote: > On Tue, Jan 10, 2017 at 02:37:01PM +0530, Gautham R. Shenoy wrote: > > From: "Gautham R. Shenoy" > > > > Balbir pointed out that in idle_book3s.S and powernv/idle.c some > > functions and vari

Re: [PATCH v5 5/5] Documentation:powerpc: Add device-tree bindings for power-mgt

2017-01-25 Thread Gautham R Shenoy
Hello Rob, Thank you very much for your review. I had missed this mail and found it while looking at the lkml thread while preparing for the next iteration. On Fri, Jan 13, 2017 at 10:57:43AM -0600, Rob Herring wrote: > On Tue, Jan 10, 2017 at 02:37:04PM +0530, Gautham R. Shenoy wrote: >

[PATCH v6 1/5] powernv:idle: Add IDLE_STATE_ENTER_SEQ_NORET macro

2017-01-25 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently all the low-power idle states are expected to wake up at reset vector 0x100. Which is why the macro IDLE_STATE_ENTER_SEQ that puts the CPU to an idle state and never returns. On ISA v3.0, when the ESL and EC bits in the PSSCR are zero, the CPU is e

[PATCH v6 0/5] powernv:stop: Use psscr_val,mask provided by firmware

2017-01-25 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" This is the sixth iteration of the patchset to use the psscr_val and psscr_mask provided by the firmware for each of the stop states. The previous versions can be found here: [v5]: https://lkml.org/lkml/2017/1/10/147 [v4]: https://lkml.org/lkml/2016/12

[PATCH v6 3/5] cpuidle:powernv: Add helper function to populate powernv idle states.

2017-01-25 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" In the current code for powernv_add_idle_states, there is a lot of code duplication while initializing an idle state in powernv_states table. Add an inline helper function to populate the powernv_states[] table for a given idle state. Invoke this for popu

[PATCH v6 2/5] powernv:stop: Rename pnv_arch300_idle_init to pnv_power9_idle_init

2017-01-25 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Balbir pointed out that the name of the function pnv_arch300_idle_init was inconsistent with the names of the variables and functions pertaining to POWER9 features in book3s_idle.S. This patch renames pnv_arch300_idle_init to pnv_power9_idle_init. This patc

[PATCH v6 4/5] powernv: Pass PSSCR value and mask to power9_idle_stop

2017-01-25 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" The power9_idle_stop method currently takes only the requested stop level as a parameter and picks up the rest of the PSSCR bits from a hand-coded macro. This is not a very flexible design, especially when the firmware has the capability to communicate the p

[PATCH v6 5/5] Documentation:powerpc: Add device-tree bindings for power-mgt

2017-01-25 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Document the device-tree bindings defining the the properties under the @power-mgt node in the device tree that describe the idle states for Linux running on baremetal POWER servers. These bindings are documented separately instead of using the the common

Re: [PATCH v6 3/5] cpuidle:powernv: Add helper function to populate powernv idle states.

2017-01-30 Thread Gautham R Shenoy
On Mon, Jan 30, 2017 at 10:17:50PM +1100, Michael Ellerman wrote: > "Rafael J. Wysocki" writes: > > > On Mon, Jan 30, 2017 at 4:47 AM, Michael Ellerman > > wrote: > >> "Gautham R. Shenoy" writes: > >> > >>> From: "Gautha

[PATCH] powernv-cpuidle: Validate DT property arrays are of same size

2017-02-23 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" The various properties associated with powernv idle states such as names, flags, residency-ns, latencies-ns, psscr, psscr-mask are exposed in the device-tree as property arrays such the pointwise entries in each of these arrays correspond to the properties o

[PATCH] powernv:idle: Fix bug due to labeling ambiguity in power_enter_stop

2017-02-26 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Commit 09206b600c76 ("powernv: Pass PSSCR value and mask to power9_idle_stop") added additional code in power_enter_stop() to distinguish between stop requests whose PSSCR had ESL=EC=1 from those which did not. When ESL=EC=1, we do a forward-jump to

Re: [PATCH] powernv:idle: Fix bug due to labeling ambiguity in power_enter_stop

2017-02-26 Thread Gautham R Shenoy
Hi Anton, On Mon, Feb 27, 2017 at 10:37:07AM +1100, Anton Blanchard wrote: > Hi Gautham, > > > +handle_esl_ec_set: > > Unless we want to expose this to things like perf, we might want to > make it a local label (eg .Lxx) Sure. We don't want to expose this to perf at least as of now! Will resend

[v2 PATCH] powernv:idle: Fix bug due to labeling ambiguity in power_enter_stop

2017-02-26 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Commit 09206b600c76 ("powernv: Pass PSSCR value and mask to power9_idle_stop") added additional code in power_enter_stop() to distinguish between stop requests whose PSSCR had ESL=EC=1 from those which did not. When ESL=EC=1, we do a forward-jump to

Re: [PATCH 1/5] powerpc/64s: move remaining system reset idle code into idle_book3s.S

2017-02-28 Thread Gautham R Shenoy
Hi Nick, This patch is fine by me. Reviewed-by: Gautham R. Shenoy On Fri, Feb 17, 2017 at 12:08 AM, Nicholas Piggin wrote: > Should be no functional change. > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/kernel/exceptions-64s.S | 26 +--- > a

Re: [PATCH 2/5] powerpc/64: stop using bit in HSPRG0 to test winkle

2017-02-28 Thread Gautham R Shenoy
Hi Nick, On Fri, Feb 17, 2017 at 12:08 AM, Nicholas Piggin wrote: > The POWER8 idle code has a neat trick of programming the power on engine > to restore a low bit into HSPRG0, so idle wakeup code can test and see > if it has been programmed this way and therefore lost all state. Restore > time c

Re: [PATCH 3/5] powerpc/64s: use alternative feature patching

2017-02-28 Thread Gautham R Shenoy
Hi Nick, On Fri, Feb 17, 2017 at 12:08 AM, Nicholas Piggin wrote: > This reduces the number of nops for POWER8 > > Signed-off-by: Nicholas Piggin This change looks ok to me. Reviewed-by: Gautham R. Shenoy > --- > arch/powerpc/kernel/idle_book3s.S | 15 +++ >

Re: [PATCH 4/5] powerpc/64s: consolidate pnv_restore_hyp_resource into pnv_powersave_wakeup

2017-02-28 Thread Gautham R Shenoy
Hi Nick, On Fri, Feb 17, 2017 at 12:09 AM, Nicholas Piggin wrote: > There is only one caller, so this reduces spaghetti of subsequent > callees returning into the caller. > > Signed-off-by: Nicholas Piggin This patch is good! Reviewed-by: Gautham R. Shenoy -- Thanks and Regards gautham.

Re: [PATCH 5/5] powerpc/64s: fix POWER9 machine check handler from stop state

2017-02-28 Thread Gautham R Shenoy
; + rlwinm. r11,r12,47-31,30,31 > + beq-4f > + BRANCH_TO_COMMON(r10, machine_check_idle_common) > 4: > + END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) > #endif > + > /* > * Check if we are coming from hypervisor userspace. If yes then we > * continue in host kernel in V mode to deliver the MC event. > -- > 2.11.0 > Otherwise, the patch looks correct to me. Reviewed-by: Gautham R. Shenoy -- Thanks and Regards gautham.

Re: [PATCH 5/5] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-10 Thread Gautham R Shenoy
t, good catch. Maybe oris r12,r12,0x3c is a better > choice than that insrdi? Perhaps oris is a better choice in this case since we are anyway setting every bit in 42:45 range. Not sure if it will save any cycles, but it will certainly reduce an instruction! > > > > > > Otherwise, the patch looks correct to me. > > Reviewed-by: Gautham R. Shenoy > > Very much appreciate the reviews. I'm just getting some time to work on > the winkle count patch, so I'll repost with your suggestions when that's > done. > Looking forward to the new version! > Thanks, > Nick > -- Thanks and Regards gautham.

[PATCH 0/3] powernv:idle: Fixes for CPU-Hotplug on POWER DD1.0

2017-03-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This patchset contains fixes to make CPU-Hotplug working on correctly on POWER9 DD1 systems. There are three patches in the series. - The first patch adds a fallback mechanism for CPU-Hotplug when no platform idle state is available. - The second pat

[PATCH 2/3] powernv:idle: Don't override default/deepest directly in kernel

2017-03-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently during idle-init on power9, if we don't find suitable stop states in the device tree that can be used as the default_stop/deepest_stop, we set stop0 (ESL=1,EC=1) as the default stop state psscr to be used by power9_idle and deepest stop state w

[PATCH 1/3] powernv:smp: Add busy-wait loop as fall back for CPU-Hotplug

2017-03-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently, the powernv cpu-offline function assumes that platform idle states such as stop on POWER9, winkle/sleep/nap on POWER8 are always available. On POWER8, it picks nap as the default state if other deep idle states like sleep/winkle are not available a

[PATCH 3/3] powernv:Recover correct PACA on wakeup from a stop on P9 DD1

2017-03-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" POWER9 platform can be configured to rebalance per-thread resources within a core in order to improve SMT performance. Certain STOP states can be configure to relinquish resources include some hypervisor SPRs in order to enable SMT thread folding. Due to rel

[v2 PATCH] powernv-cpuidle: Validate DT property array size

2017-03-15 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" The various properties associated with powernv idle states such as names, flags, residency-ns, latencies-ns, psscr, psscr-mask are exposed in the device-tree as property arrays such the pointwise entries in each of these arrays correspond to the properties o

Re: [PATCH 2/3] powernv:idle: Don't override default/deepest directly in kernel

2017-03-15 Thread Gautham R Shenoy
Hi Nick, Thanks for reviewing the patch. On Wed, Mar 15, 2017 at 12:05:43AM +1000, Nicholas Piggin wrote: > On Mon, 13 Mar 2017 11:31:27 +0530 > "Gautham R. Shenoy" wrote: > > > From: "Gautham R. Shenoy" > > > > Currently during idle-init on po

Re: [PATCH 2/8] powerpc/64s: stop using bit in HSPRG0 to test winkle

2017-03-16 Thread Gautham R Shenoy
sleeps always require a state > restore. This speedup is later re-introduced by counting per-core winkles > and setting a bitmap of threads with state loss when all are in winkle. > Looks good to me. > Signed-off-by: Nicholas Piggin Reviewed-by: Gautham R. Shenoy -- Thanks and Regards gautham.

Re: [PATCH 3/8] powerpc/64s: use alternative feature patching

2017-03-16 Thread Gautham R Shenoy
On Tue, Mar 14, 2017 at 07:23:44PM +1000, Nicholas Piggin wrote: > This reduces the number of nops for POWER8. Nice! > > Signed-off-by: Nicholas Piggin Reviewed-by: Gautham R. Shenoy > --- > arch/powerpc/kernel/idle_book3s.S | 19 --- > 1 file changed, 1

Re: [PATCH 5/8] powerpc/64s: use PACA_THREAD_IDLE_STATE only in POWER8

2017-03-16 Thread Gautham R Shenoy
Hi Nick, On Tue, Mar 14, 2017 at 07:23:46PM +1000, Nicholas Piggin wrote: > POWER9 does not use this field, so it should be moved into the POWER8 > code. Update the documentation in the paca struct too. > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/include/asm/paca.h | 12 ++

Re: [PATCH 6/8] powerpc/64s: idle expand usable core idle state bits

2017-03-16 Thread Gautham R Shenoy
omic operations while we're here. Looks good. Reviewed-by: Gautham R. Shenoy > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/include/asm/cpuidle.h | 4 ++-- > arch/powerpc/kernel/idle_book3s.S | 33 + > 2 files changed, 19 in

Re: [PATCH 7/8] powerpc/64s: idle do not hold reservation longer than required

2017-03-16 Thread Gautham R Shenoy
; - lbz r7,PACA_THREAD_MASK(r13) > ld r14,PACA_CORE_IDLE_STATE_PTR(r13) > -lwarx_loop2: > - lwarx r15,0,r14 > - andis. r9,r15,PNV_CORE_IDLE_LOCK_BIT@h > + lbz r7,PACA_THREAD_MASK(r13) Is reversing the order of loads into r7 and r14 intentional? Other

Re: [PATCH 4/8] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-16 Thread Gautham R Shenoy
p > > > as the system reset interrupt does, rather than attempting to sleep > > > again without going through the main idle path. > > > > > > Reviewed-by: Gautham R. Shenoy > > > Signed-off-by: Nicholas Pig

Re: [PATCH 8/8] powerpc/64s: idle POWER8 avoid full state loss recovery when possible

2017-03-16 Thread Gautham R Shenoy
Hi Nick, On Tue, Mar 14, 2017 at 07:23:49PM +1000, Nicholas Piggin wrote: > If not all threads were in winkle, full state loss recovery is not > necessary and can be avoided. A previous patch removed this optimisation > due to some complexity with the implementation. Re-implement it by > counting

Re: [PATCH] powerpc/64s: fix idle wakeup potential to clobber registers

2017-03-17 Thread Gautham R Shenoy
nding when the sleep/winkle instruction is executed. > > Signed-off-by: Nicholas Piggin Acked-by: Gautham R. Shenoy This fix should go into stable v4.8,v4.9 and v4.10. Prior to commit 83289f909a72 ("powerpc/powernv: Rename idle_power7.S to idle_book3s.S"), pnv_wakeup_tb_loss was exp

Re: [PATCH 7/7] powerpc/64s: idle POWER8 avoid full state loss recovery where possible

2017-03-20 Thread Gautham R Shenoy
NV_CORE_IDLE_WINKLE_COUNT_ALL_BIT@h > + subis r15,r15,PNV_CORE_IDLE_WINKLE_COUNT@h > + beq 2f > + ori r15,r15,PNV_CORE_IDLE_THREAD_WINKLE_BITS /* all were winkle */ > +2: > + /* Shift thread bit to winkle mask, then test if this thread is set, >

[v2 PATCH 1/4] powernv: Move CPU-Offline idle state invocation from smp.c to idle.c

2017-03-20 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Move the piece of code in powernv/smp.c::pnv_smp_cpu_kill_self() which transitions the CPU to the deepest available platform idle state to a new function named pnv_cpu_offline() in powernv/idle.c. The rationale behind this code movement is that the data r

[v2 PATCH 4/4] powernv: Recover correct PACA on wakeup from a stop on P9 DD1

2017-03-20 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" POWER9 DD1.0 hardware has an issue due to which the SPRs of a thread waking up from stop 0,1,2 with ESL=1 can endup being misplaced in the core. Thus the HSPRG0 of a thread waking up from can contain the paca pointer of its sibling. This patch implements

[v2 PATCH 0/4] powernv:idle: Fixes for CPU-Hotplug on POWER DD1.0

2017-03-20 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the second version of the patchset containing the fixes to make CPU-Hotplug working on correctly on POWER9 DD1 systems. The earlier version of this patchset can be found here: https://lkml.org/lkml/2017/3/13/46 This patch addresses the feedbac

[v2 PATCH 2/4] powernv:smp: Add busy-wait loop as fall back for CPU-Hotplug

2017-03-20 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently, the powernv cpu-offline function assumes that platform idle states such as stop on POWER9, winkle/sleep/nap on POWER8 are always available. On POWER8, it picks nap as the default state if other deep idle states like sleep/winkle are not available a

[v2 PATCH 3/4] powernv:idle: Don't override default/deepest directly in kernel

2017-03-20 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently during idle-init on power9, if we don't find suitable stop states in the device tree that can be used as the default_stop/deepest_stop, we set stop0 (ESL=1,EC=1) as the default stop state psscr to be used by power9_idle and deepest stop state w

Re: [PATCH 7/7] powerpc/64s: idle POWER8 avoid full state loss recovery where possible

2017-03-20 Thread Gautham R Shenoy
Hi Nick, On Mon, Mar 20, 2017 at 08:26:05PM +1000, Nicholas Piggin wrote: > On Mon, 20 Mar 2017 15:41:39 +0530 > Gautham R Shenoy wrote: > > > Hi Nick, > > > > On Mon, Mar 20, 2017 at 04:01:52PM +1000, Nicholas Piggin wrote: > > > If not all threads were in

Re: [v2 PATCH 1/4] powernv: Move CPU-Offline idle state invocation from smp.c to idle.c

2017-03-21 Thread Gautham R Shenoy
Hi Nick, On Tue, Mar 21, 2017 at 02:35:17AM +1000, Nicholas Piggin wrote: > On Mon, 20 Mar 2017 21:24:15 +0530 > "Gautham R. Shenoy" wrote: > > > From: "Gautham R. Shenoy" > > > > Move the piece of code in powernv/smp.c::pnv_smp_cpu_kill_self

Re: [v2 PATCH 3/4] powernv:idle: Don't override default/deepest directly in kernel

2017-03-21 Thread Gautham R Shenoy
Hi, On Tue, Mar 21, 2017 at 02:39:34AM +1000, Nicholas Piggin wrote: > > @@ -241,8 +240,9 @@ static DEVICE_ATTR(fastsleep_workaround_applyonce, 0600, > > * The default stop state that will be used by ppc_md.power_save > > * function on platforms that support stop instruction. > > */ > > -u64

Re: [v2 PATCH 4/4] powernv: Recover correct PACA on wakeup from a stop on P9 DD1

2017-03-21 Thread Gautham R Shenoy
On Tue, Mar 21, 2017 at 02:59:46AM +1000, Nicholas Piggin wrote: > On Mon, 20 Mar 2017 21:24:18 +0530 > "Gautham R. Shenoy" wrote: > > > From: "Gautham R. Shenoy" > > > > POWER9 DD1.0 hardware has an issue due to which the SPRs of a thread >

[v3 PATCH 0/4] powernv:idle: Fixes for CPU-Hotplug on POWER DD1.0

2017-03-22 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the third version of the patchset containing the fixes to make CPU-Hotplug working on correctly on POWER9 DD1 systems. The earlier versions can be found here: [v2] : https://lkml.org/lkml/2017/3/20/555 [v1] : https://lkml.org/lkml/2017/3/13/46

[v3 PATCH 2/4] powernv:smp: Add busy-wait loop as fall back for CPU-Hotplug

2017-03-22 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently, the powernv cpu-offline function assumes that platform idle states such as stop on POWER9, winkle/sleep/nap on POWER8 are always available. On POWER8, it picks nap as the default state if other deep idle states like sleep/winkle are not available a

[v3 PATCH 3/4] powernv:idle: Don't override default/deepest directly in kernel

2017-03-22 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently during idle-init on power9, if we don't find suitable stop states in the device tree that can be used as the default_stop/deepest_stop, we set stop0 (ESL=1,EC=1) as the default stop state psscr to be used by power9_idle and deepest stop state w

[v3 PATCH 4/4] powernv: Recover correct PACA on wakeup from a stop on P9 DD1

2017-03-22 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" POWER9 DD1.0 hardware has an issue due to which the SPRs of a thread waking up from stop 0,1,2 with ESL=1 can endup being misplaced in the core. Thus the HSPRG0 of a thread waking up from can contain the paca pointer of its sibling. This patch implements

[v3 PATCH 1/4] powernv: Move CPU-Offline idle state invocation from smp.c to idle.c

2017-03-22 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Move the piece of code in powernv/smp.c::pnv_smp_cpu_kill_self() which transitions the CPU to the deepest available platform idle state to a new function named pnv_cpu_offline() in powernv/idle.c. The rationale behind this code movement is that the data r

Re: [PATCH v5 06/13] powerpc/perf: IMC pmu cpumask and cpu hotplug support

2017-03-23 Thread Gautham R Shenoy
plug, dying CPU is checked to see whether it is one of the > designated cpus, if yes, next online cpu from the same chip (for nest > units) is designated as new cpu to read counters. For this purpose, we > introduce a new state : CPUHP_AP_PERF_POWERPC_NEST_ONLINE. > > Cc: Gautham R.

Re: [PATCH v5 08/13] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-03-23 Thread Gautham R Shenoy
Hi Maddy, Hemant, Anju, On Thu, Mar 16, 2017 at 01:05:02PM +0530, Madhavan Srinivasan wrote: [..snip..] > + > +static void core_imc_change_cpu_context(int old_cpu, int new_cpu) > +{ > + if (!core_imc_pmu) > + return; > + perf_pmu_migrate_context(&core_imc_pmu->pmu, old_cpu, n

Re: [PATCH 12/13] powerpc/perf: Thread imc cpuhotplug support

2017-03-23 Thread Gautham R Shenoy
ous ldbar value is written back to the LDBAR for that > cpu. > > To register the hotplug functions for thread_imc, a new state > CPUHP_AP_PERF_POWERPC_THREADIMC_ONLINE is added to the list of existing > states. > > Cc: Gautham R. Shenoy > Cc: Balbir Singh > Cc: Benja

Re: [PATCH v2 1/2] powerpc/powernv/cpuidle: Pass correct drv->cpumask for registration

2017-03-24 Thread Gautham R Shenoy
5c/0x78 > > This patch fixes the bug by passing correct cpumask from > powernv-cpuidle driver. > > Signed-off-by: Vaidyanathan Srinivasan Reviewed-by: Gautham R. Shenoy > --- > drivers/cpuidle/cpuidle-powernv.c | 18 ++ > 1 file changed, 18 insertion

Re: [v3 PATCH 2/4] powernv:smp: Add busy-wait loop as fall back for CPU-Hotplug

2017-03-30 Thread Gautham R Shenoy
On Mon, Mar 27, 2017 at 10:43:44PM +1100, Michael Ellerman wrote: > "Gautham R. Shenoy" writes: > > > diff --git a/arch/powerpc/platforms/powernv/idle.c > > b/arch/powerpc/platforms/powernv/idle.c > > index 419edff..f335e0f 100644 > > --- a/arch/powerpc

Re: [PATCH] cpufreq: powernv: Define methods to parse positive & negative pstates

2017-12-06 Thread Gautham R Shenoy
Hi Michael, On Wed, Dec 06, 2017 at 09:54:27PM +1100, Michael Ellerman wrote: > Shilpasri G Bhat writes: > > > From: "Gautham R. Shenoy" > > > > Pstates are 8bit values but on POWER8 they are negative and on POWER9 > > they are positive. This patch adds

[v2 PATCH] cpufreq: powernv: Correctly parse the sign of pstates on POWER8 vs POWER9

2017-12-06 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On POWERNV platform, Pstates are 8-bit values. On POWER8 they are negatively numbered while on POWER9 they are positively numbered. Thus, on POWER9, the maximum number of pstates could be as high as 256. The current code interprets pstates as a signed 8-bit v

Re: [v2 PATCH] cpufreq: powernv: Correctly parse the sign of pstates on POWER8 vs POWER9

2017-12-10 Thread Gautham R Shenoy
Hi Balbir, On Fri, Dec 08, 2017 at 02:44:40PM +1100, Balbir Singh wrote: > On Thu, Dec 7, 2017 at 4:59 PM, Gautham R. Shenoy > wrote: > > From: "Gautham R. Shenoy" > > > > On POWERNV platform, Pstates are 8-bit values. On POWER8 they are > > nega

[v3 PATCH 3/3] powernv-cpufreq: Treat pstates as opaque 8-bit values

2017-12-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On POWER8 and POWER9, the PMSR and the PMCR registers define pstates to be 8-bit wide values. The device-tree exports pstates as 32-bit wide values of which the lower byte is the actual pstate. The current implementation in the kernel treats pstates as in

<    1   2   3   4   5   6   7   >