mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Will Deacon <will@kernel.org>
Cc: Waiman Long <longman@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	linux-kernel@vger.kernel.org, Borislav Petkov <bp@suse.de>,
	Ali Saidi <alisaidi@amazon.com>,
	Steve Capper <steve.capper@arm.com>
Subject: Re: [PATCH] locking/qrwlock: queued_write_lock_slowpath() cleanup
Date: Tue, 4 May 2021 11:19:48 +0200	[thread overview]
Message-ID: <YJERtJD012uGlp4C@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210427075659.GA6675@willie-the-truck>

On Tue, Apr 27, 2021 at 08:56:59AM +0100, Will Deacon wrote:
> On Mon, Apr 26, 2021 at 02:50:17PM -0400, Waiman Long wrote:
> > Make the code more readable by replacing the atomic_cmpxchg_acquire()
> > by an equivalent atomic_try_cmpxchg_acquire() and change atomic_add()
> > to atomic_or().
> > 
> > For architectures that use qrwlock, I do not find one that has an
> > atomic_add() defined but not an atomic_or().  I guess it should be fine
> > by changing atomic_add() to atomic_or().
> > 
> > Note that the previous use of atomic_add() isn't wrong as only one
> > writer that is the wait_lock owner can set the waiting flag and the
> > flag will be cleared later on when acquiring the write lock.
> 
> Right, there's no functional change here.
> 
> > Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> > Signed-off-by: Waiman Long <longman@redhat.com>

> Acked-by: Will Deacon <will@kernel.org>

Thanks!

  reply	other threads:[~2021-05-04  9:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 18:50 Waiman Long
2021-04-26 18:51 ` Waiman Long
2021-04-27  7:56 ` Will Deacon
2021-05-04  9:19   ` Peter Zijlstra [this message]
2021-05-06 13:48 ` [tip: locking/urgent] locking/qrwlock: Cleanup queued_write_lock_slowpath() tip-bot2 for Waiman Long
  -- strict thread matches above, loose matches on Subject: below --
2021-04-25 20:06 [PATCH] locking/qrwlock: queued_write_lock_slowpath() cleanup Waiman Long
2021-04-26  8:08 ` Peter Zijlstra
2021-04-26 14:54   ` Waiman Long

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=YJERtJD012uGlp4C@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=alisaidi@amazon.com \
    --cc=boqun.feng@gmail.com \
    --cc=bp@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=steve.capper@arm.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®