From: Waiman Long <longman@redhat.com>
To: Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] locking/qspinlock: Fix state-transition changes in comments
Date: Tue, 9 May 2023 11:09:57 -0400 [thread overview]
Message-ID: <1428e38f-6dee-a162-b2e0-03604d73f889@redhat.com> (raw)
In-Reply-To: <20230509072902.66284-1-qiuxu.zhuo@intel.com>
On 5/9/23 03:29, Qiuxu Zhuo wrote:
> 1. set_locked() only sets the locked field to 1 and doesn't touch
> the pending field. So the correct lock state transition is:
>
> *,*,0 -> *,*,1
>
> 2. The initial lock state when calling clear_pending_set_locked() is
> the state just after waiting for the locker goes away. So the
> state transition for clear_pending_set_locked() is:
>
> *,1,0 -> *,0,1
>
> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
> ---
> v1->v2:
> - Drop the state transition comments fixes (viewed from the current lock word value).
> - Update the commit message accordingly.
>
> kernel/locking/qspinlock.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c
> index ebe6b8ec7cb3..256021c87ac1 100644
> --- a/kernel/locking/qspinlock.c
> +++ b/kernel/locking/qspinlock.c
> @@ -257,7 +257,7 @@ static __always_inline u32 queued_fetch_set_pending_acquire(struct qspinlock *lo
> * set_locked - Set the lock bit and own the lock
> * @lock: Pointer to queued spinlock structure
> *
> - * *,*,0 -> *,0,1
> + * *,*,0 -> *,*,1
> */
> static __always_inline void set_locked(struct qspinlock *lock)
> {
> @@ -385,7 +385,7 @@ void __lockfunc queued_spin_lock_slowpath(struct qspinlock *lock, u32 val)
> /*
> * take ownership and clear the pending bit.
> *
> - * 0,1,0 -> 0,0,1
> + * *,1,0 -> *,0,1
> */
> clear_pending_set_locked(lock);
> lockevent_inc(lock_pending);
Acked-by: Waiman Long <longman@redhat.com>
next prev parent reply other threads:[~2023-05-09 15:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-06 6:29 [PATCH " Qiuxu Zhuo
2023-05-08 15:29 ` Waiman Long
2023-05-09 2:03 ` Zhuo, Qiuxu
2023-05-09 2:30 ` Waiman Long
2023-05-09 6:57 ` Zhuo, Qiuxu
2023-05-09 7:29 ` [PATCH v2 " Qiuxu Zhuo
2023-05-09 15:09 ` Waiman Long [this message]
2023-05-09 14:57 ` [PATCH " Waiman Long
2023-05-10 5:28 ` Zhuo, Qiuxu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428e38f-6dee-a162-b2e0-03604d73f889@redhat.com \
--to=longman@redhat.com \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=qiuxu.zhuo@intel.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®