[PATCH] sched/membarrier: Fix redundant load of membarrier_state

2024-10-06 Thread Nysal Jan K.A.
From: "Nysal Jan K.A" On architectures where ARCH_HAS_SYNC_CORE_BEFORE_USERMODE is not selected, sync_core_before_usermode() is a no-op. In membarrier_mm_sync_core_before_usermode() the compiler does not eliminate redundant branches and the load of mm->membarrier_state for thi

[PATCH v2] powerpc/qspinlock: Fix deadlock in MCS queue

2024-08-28 Thread Nysal Jan K.A.
...@vger.kernel.org # v6.2+ Reported-by: Geetika Moolchandani Reported-by: Vaishnavi Bhat Reported-by: Jijo Varghese Signed-off-by: Nysal Jan K.A. Reviewed-by: Nicholas Piggin --- arch/powerpc/lib/qspinlock.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch

Re: [PATCH] powerpc/qspinlock: Fix deadlock in MCS queue

2024-08-27 Thread Nysal Jan K.A.
On Wed, Aug 28, 2024 at 01:52:33PM GMT, Michael Ellerman wrote: > "Nysal Jan K.A." writes: > > If an interrupt occurs in queued_spin_lock_slowpath() after we increment > > qnodesp->count and before node->lock is initialized, another CPU might > > see stale lo

Re: [PATCH] powerpc/qspinlock: Fix deadlock in MCS queue

2024-08-27 Thread Nysal Jan K.A.
On Wed, Aug 28, 2024 at 01:19:46PM GMT, Nicholas Piggin wrote: > What probably makes it really difficult to hit is that I think both > locks A and B need contention from other sources to push them into > queueing slow path. I guess that's omitted for brevity in the flow > above, which is fine. >

[PATCH] powerpc/qspinlock: Fix deadlock in MCS queue

2024-08-26 Thread Nysal Jan K.A.
tika Moolchandani Reported-by: Vaishnavi Bhat Reported-by: Jijo Varghese Signed-off-by: Nysal Jan K.A. --- arch/powerpc/lib/qspinlock.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/lib/qspinlock.c b/arch/powerpc/lib/qspinlock.c index 5de4dd549f6e..59861c665cef 100644 --- a

Re: [PATCH] powerpc/pseries: Fix dtl_access_lock to be a rw_semaphore

2024-08-21 Thread Nysal Jan K.A.
include/asm/dtl.h > +++ b/arch/powerpc/include/asm/dtl.h > @@ -1,6 +1,7 @@ > #ifndef _ASM_POWERPC_DTL_H > #define _ASM_POWERPC_DTL_H > > +#include > #include > #include The above include is redundant now and can be removed. Reviewed-by: Nysal Jan K

[PATCH v2 2/2] powerpc/topology: Check if a core is online

2024-07-30 Thread Nysal Jan K.A.
From: "Nysal Jan K.A" topology_is_core_online() checks if the core a CPU belongs to is online. The core is online if at least one of the sibling CPUs is online. The first CPU of an online core is also online in the common case, so this should be fairly quick. Signed-off-by: Nys

[PATCH v2 0/2] Skip offline cores when enabling SMT on PowerPC

2024-07-30 Thread Nysal Jan K.A.
From: "Nysal Jan K.A" After the addition of HOTPLUG_SMT support for PowerPC [1] there was a regression reported [2] when enabling SMT. On a system with at least one offline core, when enabling SMT, the expectation is that no CPUs of offline cores are made online. On a POWER9 system wi

[PATCH v2 1/2] cpu/SMT: Enable SMT only if a core is online

2024-07-30 Thread Nysal Jan K.A.
From: "Nysal Jan K.A" If a core is offline then enabling SMT should not online CPUs of this core. By enabling SMT, what is intended is either changing the SMT value from "off" to "on" or setting the SMT level (threads per core) from a lower to higher value. On Pow

Re: [PATCH 2/2] powerpc/topology: Check if a core is online

2024-06-24 Thread Nysal Jan K.A.
On Tue, Jun 25, 2024 at 12:36:33AM GMT, Shrikanth Hegde wrote: > > --- a/arch/powerpc/include/asm/topology.h > > +++ b/arch/powerpc/include/asm/topology.h > > @@ -145,6 +145,7 @@ static inline int cpu_to_coregroup_id(int cpu) > > > > #ifdef CONFIG_HOTPLUG_SMT > > #include > > +#include > > I

Re: [PATCH 0/2] Skip offline cores when enabling SMT on PowerPC

2024-06-13 Thread Nysal Jan K.A.
On Thu, Jun 13, 2024 at 09:34:10PM GMT, Michael Ellerman wrote: > "Nysal Jan K.A." writes: > > From: "Nysal Jan K.A" > > > > After the addition of HOTPLUG_SMT support for PowerPC [1] there was a > > regression reported [2] when enabling SMT. >

[PATCH 2/2] powerpc/topology: Check if a core is online

2024-06-12 Thread Nysal Jan K.A.
From: "Nysal Jan K.A" topology_is_core_online() checks if the core a CPU belongs to is online. The core is online if at least one of the sibling CPUs is online. The first CPU of an online core is also online in the common case, so this should be fairly quick. Signed-off-by: Nys

[PATCH 1/2] cpu/SMT: Enable SMT only if a core is online

2024-06-12 Thread Nysal Jan K.A.
From: "Nysal Jan K.A" If a core is offline then enabling SMT should not online CPUs of this core. By enabling SMT, what is intended is either changing the SMT value from "off" to "on" or setting the SMT level (threads per core) from a lower to higher value. On Pow

[PATCH 0/2] Skip offline cores when enabling SMT on PowerPC

2024-06-12 Thread Nysal Jan K.A.
From: "Nysal Jan K.A" After the addition of HOTPLUG_SMT support for PowerPC [1] there was a regression reported [2] when enabling SMT. On a system with at least one offline core, when enabling SMT, the expectation is that no CPUs of offline cores are made online. On a POWER9 system wi

Re: [PATCH 0/6] powerpc/qspinlock: Fix yield latency bug and other

2023-10-20 Thread Nysal Jan K.A.
c | 119 +++ > 1 file changed, 52 insertions(+), 67 deletions(-) > > -- > 2.42.0 > Just a minor comment regarding patch 2. For the series: Reviewed-by: Nysal Jan K.A

Re: [PATCH 2/6] powerpc/qspinlock: stop queued waiters trying to set lock sleepy

2023-10-20 Thread Nysal Jan K.A.
On Mon, Oct 16, 2023 at 10:43:01PM +1000, Nicholas Piggin wrote: > If a queued waiter notices the lock owner or the previous waiter has > been preempted, it attempts to mark the lock sleepy, but it does this > as a try-set operation using the original lock value it got when > queueing, which will b

Re: [PATCH] powerpc/atomics: Remove unused function

2023-03-23 Thread Nysal Jan K.A.
Michael, Any comments on this one? On Fri, Feb 24, 2023 at 11:02:31AM +, Christophe Leroy wrote: > > > Le 24/02/2023 à 11:39, Nysal Jan K.A a écrit : > > [Vous ne recevez pas souvent de courriers de ny...@linux.ibm.com. Découvrez > > pourquoi ceci est impor

[PATCH] powerpc/atomics: Remove unused function

2023-02-24 Thread Nysal Jan K.A
Remove arch_atomic_try_cmpxchg_lock function as it is no longer used since commit 9f61521c7a28 ("powerpc/qspinlock: powerpc qspinlock implementation") Signed-off-by: Nysal Jan K.A --- arch/powerpc/include/asm/atomic.h | 29 - 1 file changed, 29 deletion