* [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
@ 2024-04-22 15:17 Uros Bizjak
2024-04-22 19:45 ` Boqun Feng
2024-04-24 10:04 ` [tip: locking/core] " tip-bot2 for Uros Bizjak
0 siblings, 2 replies; 7+ messages in thread
From: Uros Bizjak @ 2024-04-22 15:17 UTC (permalink / raw)
To: x86, linux-kernel
Cc: Uros Bizjak, Peter Zijlstra, Ingo Molnar, Will Deacon,
Waiman Long, Boqun Feng
Use _Q_LOCKED_VAL instead of hardcoded $0x1 in PV_UNLOCK_ASM macro.
No functional changes intended.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Waiman Long <longman@redhat.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
---
arch/x86/include/asm/qspinlock_paravirt.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/include/asm/qspinlock_paravirt.h
index 466af57b8ed6..0a985784be9b 100644
--- a/arch/x86/include/asm/qspinlock_paravirt.h
+++ b/arch/x86/include/asm/qspinlock_paravirt.h
@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");
#define PV_UNLOCK_ASM \
FRAME_BEGIN \
"push %rdx\n\t" \
- "mov $0x1,%eax\n\t" \
+ "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \
"xor %edx,%edx\n\t" \
LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \
"jne .slowpath\n\t" \
--
2.42.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
2024-04-22 15:17 [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro Uros Bizjak
@ 2024-04-22 19:45 ` Boqun Feng
2024-04-22 19:57 ` Uros Bizjak
2024-04-24 10:04 ` [tip: locking/core] " tip-bot2 for Uros Bizjak
1 sibling, 1 reply; 7+ messages in thread
From: Boqun Feng @ 2024-04-22 19:45 UTC (permalink / raw)
To: Uros Bizjak
Cc: x86, linux-kernel, Peter Zijlstra, Ingo Molnar, Will Deacon,
Waiman Long
On Mon, Apr 22, 2024 at 05:17:35PM +0200, Uros Bizjak wrote:
> Use _Q_LOCKED_VAL instead of hardcoded $0x1 in PV_UNLOCK_ASM macro.
>
> No functional changes intended.
>
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Will Deacon <will@kernel.org>
> Cc: Waiman Long <longman@redhat.com>
> Cc: Boqun Feng <boqun.feng@gmail.com>
> ---
> arch/x86/include/asm/qspinlock_paravirt.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/include/asm/qspinlock_paravirt.h
> index 466af57b8ed6..0a985784be9b 100644
> --- a/arch/x86/include/asm/qspinlock_paravirt.h
> +++ b/arch/x86/include/asm/qspinlock_paravirt.h
> @@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");
> #define PV_UNLOCK_ASM \
> FRAME_BEGIN \
> "push %rdx\n\t" \
> - "mov $0x1,%eax\n\t" \
> + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \
> "xor %edx,%edx\n\t" \
> LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \
> "jne .slowpath\n\t" \
There is also a "cmp $0x1,%al" afterwards.
Regards,
Boqun
> --
> 2.42.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
2024-04-22 19:45 ` Boqun Feng
@ 2024-04-22 19:57 ` Uros Bizjak
2024-04-22 20:00 ` Boqun Feng
0 siblings, 1 reply; 7+ messages in thread
From: Uros Bizjak @ 2024-04-22 19:57 UTC (permalink / raw)
To: Boqun Feng
Cc: x86, linux-kernel, Peter Zijlstra, Ingo Molnar, Will Deacon,
Waiman Long
On Mon, Apr 22, 2024 at 9:45 PM Boqun Feng <boqun.feng@gmail.com> wrote:
> > diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/include/asm/qspinlock_paravirt.h
> > index 466af57b8ed6..0a985784be9b 100644
> > --- a/arch/x86/include/asm/qspinlock_paravirt.h
> > +++ b/arch/x86/include/asm/qspinlock_paravirt.h
> > @@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");
> > #define PV_UNLOCK_ASM \
> > FRAME_BEGIN \
> > "push %rdx\n\t" \
> > - "mov $0x1,%eax\n\t" \
> > + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \
> > "xor %edx,%edx\n\t" \
> > LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \
> > "jne .slowpath\n\t" \
>
> There is also a "cmp $0x1,%al" afterwards.
Not anymore. Please note that the patch is against -tip, where we have:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=91095666125a666c8f20c2323b742c53165c0325
Thanks,
Uros.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
2024-04-22 19:57 ` Uros Bizjak
@ 2024-04-22 20:00 ` Boqun Feng
2024-04-22 20:12 ` Uros Bizjak
0 siblings, 1 reply; 7+ messages in thread
From: Boqun Feng @ 2024-04-22 20:00 UTC (permalink / raw)
To: Uros Bizjak
Cc: x86, linux-kernel, Peter Zijlstra, Ingo Molnar, Will Deacon,
Waiman Long
On Mon, Apr 22, 2024 at 09:57:04PM +0200, Uros Bizjak wrote:
> On Mon, Apr 22, 2024 at 9:45 PM Boqun Feng <boqun.feng@gmail.com> wrote:
>
> > > diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/include/asm/qspinlock_paravirt.h
> > > index 466af57b8ed6..0a985784be9b 100644
> > > --- a/arch/x86/include/asm/qspinlock_paravirt.h
> > > +++ b/arch/x86/include/asm/qspinlock_paravirt.h
> > > @@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");
> > > #define PV_UNLOCK_ASM \
> > > FRAME_BEGIN \
> > > "push %rdx\n\t" \
> > > - "mov $0x1,%eax\n\t" \
> > > + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \
> > > "xor %edx,%edx\n\t" \
> > > LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \
> > > "jne .slowpath\n\t" \
> >
> > There is also a "cmp $0x1,%al" afterwards.
>
> Not anymore. Please note that the patch is against -tip, where we have:
>
Oh, thanks for the information. Maybe it makes sense to mention the
patches dependency in the commit log?
Regards,
Boqun
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=91095666125a666c8f20c2323b742c53165c0325
>
> Thanks,
> Uros.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
2024-04-22 20:00 ` Boqun Feng
@ 2024-04-22 20:12 ` Uros Bizjak
2024-04-22 22:28 ` Boqun Feng
0 siblings, 1 reply; 7+ messages in thread
From: Uros Bizjak @ 2024-04-22 20:12 UTC (permalink / raw)
To: Boqun Feng
Cc: x86, linux-kernel, Peter Zijlstra, Ingo Molnar, Will Deacon,
Waiman Long
On Mon, Apr 22, 2024 at 10:00 PM Boqun Feng <boqun.feng@gmail.com> wrote:
>
> On Mon, Apr 22, 2024 at 09:57:04PM +0200, Uros Bizjak wrote:
> > On Mon, Apr 22, 2024 at 9:45 PM Boqun Feng <boqun.feng@gmail.com> wrote:
> >
> > > > diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/include/asm/qspinlock_paravirt.h
> > > > index 466af57b8ed6..0a985784be9b 100644
> > > > --- a/arch/x86/include/asm/qspinlock_paravirt.h
> > > > +++ b/arch/x86/include/asm/qspinlock_paravirt.h
> > > > @@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");
> > > > #define PV_UNLOCK_ASM \
> > > > FRAME_BEGIN \
> > > > "push %rdx\n\t" \
> > > > - "mov $0x1,%eax\n\t" \
> > > > + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \
> > > > "xor %edx,%edx\n\t" \
> > > > LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \
> > > > "jne .slowpath\n\t" \
> > >
> > > There is also a "cmp $0x1,%al" afterwards.
> >
> > Not anymore. Please note that the patch is against -tip, where we have:
> >
>
> Oh, thanks for the information. Maybe it makes sense to mention the
> patches dependency in the commit log?
Hm, yes ... I should mention this as "[PATCH -tip]" in the subject
line to avoid confusion with this particular patch.
Thanks,
Uros.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
2024-04-22 20:12 ` Uros Bizjak
@ 2024-04-22 22:28 ` Boqun Feng
0 siblings, 0 replies; 7+ messages in thread
From: Boqun Feng @ 2024-04-22 22:28 UTC (permalink / raw)
To: Uros Bizjak
Cc: x86, linux-kernel, Peter Zijlstra, Ingo Molnar, Will Deacon,
Waiman Long
On Mon, Apr 22, 2024 at 10:12:11PM +0200, Uros Bizjak wrote:
> On Mon, Apr 22, 2024 at 10:00 PM Boqun Feng <boqun.feng@gmail.com> wrote:
> >
> > On Mon, Apr 22, 2024 at 09:57:04PM +0200, Uros Bizjak wrote:
> > > On Mon, Apr 22, 2024 at 9:45 PM Boqun Feng <boqun.feng@gmail.com> wrote:
> > >
> > > > > diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/include/asm/qspinlock_paravirt.h
> > > > > index 466af57b8ed6..0a985784be9b 100644
> > > > > --- a/arch/x86/include/asm/qspinlock_paravirt.h
> > > > > +++ b/arch/x86/include/asm/qspinlock_paravirt.h
> > > > > @@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");
> > > > > #define PV_UNLOCK_ASM \
> > > > > FRAME_BEGIN \
> > > > > "push %rdx\n\t" \
> > > > > - "mov $0x1,%eax\n\t" \
> > > > > + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \
> > > > > "xor %edx,%edx\n\t" \
> > > > > LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \
> > > > > "jne .slowpath\n\t" \
> > > >
> > > > There is also a "cmp $0x1,%al" afterwards.
> > >
> > > Not anymore. Please note that the patch is against -tip, where we have:
> > >
> >
> > Oh, thanks for the information. Maybe it makes sense to mention the
> > patches dependency in the commit log?
>
> Hm, yes ... I should mention this as "[PATCH -tip]" in the subject
> line to avoid confusion with this particular patch.
>
Anyway, the code looks good to me.
Acked-by: Boqun Feng <boqun.feng@gmail.com>
Regards,
Boqun
> Thanks,
> Uros.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: locking/core] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
2024-04-22 15:17 [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro Uros Bizjak
2024-04-22 19:45 ` Boqun Feng
@ 2024-04-24 10:04 ` tip-bot2 for Uros Bizjak
1 sibling, 0 replies; 7+ messages in thread
From: tip-bot2 for Uros Bizjak @ 2024-04-24 10:04 UTC (permalink / raw)
To: linux-tip-commits
Cc: Uros Bizjak, Ingo Molnar, Boqun Feng, Waiman Long, Linus Torvalds,
x86, linux-kernel
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 532453e7aa78f3962fb4d86caf40ff81ebf62160
Gitweb: https://git.kernel.org/tip/532453e7aa78f3962fb4d86caf40ff81ebf62160
Author: Uros Bizjak <ubizjak@gmail.com>
AuthorDate: Mon, 22 Apr 2024 17:17:35 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 24 Apr 2024 11:48:08 +02:00
locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
Use _Q_LOCKED_VAL instead of hardcoded $0x1 in PV_UNLOCK_ASM macro.
No functional changes intended.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Boqun Feng <boqun.feng@gmail.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20240422151752.53997-1-ubizjak@gmail.com
---
arch/x86/include/asm/qspinlock_paravirt.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/include/asm/qspinlock_paravirt.h
index 466af57..0a98578 100644
--- a/arch/x86/include/asm/qspinlock_paravirt.h
+++ b/arch/x86/include/asm/qspinlock_paravirt.h
@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");
#define PV_UNLOCK_ASM \
FRAME_BEGIN \
"push %rdx\n\t" \
- "mov $0x1,%eax\n\t" \
+ "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \
"xor %edx,%edx\n\t" \
LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \
"jne .slowpath\n\t" \
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-04-24 10:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22 15:17 [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro Uros Bizjak
2024-04-22 19:45 ` Boqun Feng
2024-04-22 19:57 ` Uros Bizjak
2024-04-22 20:00 ` Boqun Feng
2024-04-22 20:12 ` Uros Bizjak
2024-04-22 22:28 ` Boqun Feng
2024-04-24 10:04 ` [tip: locking/core] " tip-bot2 for Uros Bizjak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox