linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: cl@gentwo.org, Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Boqun Feng <boqun.feng@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH RFC] Avoid memory barrier in read_seqcount() through load acquire
Date: Tue, 13 Aug 2024 16:23:54 -0400	[thread overview]
Message-ID: <b770230f-7721-461b-a9f8-b482284c4a94@redhat.com> (raw)
In-Reply-To: <CAHk-=why9gTVRPHwbyz-24QSmKW1zXrF_pbS-UtDyQddyzEu9A@mail.gmail.com>


On 8/13/24 16:01, Linus Torvalds wrote:
> On Tue, 13 Aug 2024 at 12:58, Waiman Long <longman@redhat.com> wrote:
>> Sorry for the confusion. What you said above is actually the reason that
>> I ask this question. In the same way, smp_rmb()/wmb() is available for
>> all arches. I am actually asking if it should be a flag that indicates
>> the arch's preference to use acquire/release over rmb/wmb.
> I think that if an arch says it has native acquire/release, we should
> basically assume that it's the better model.
>
> I mean, we could certainly use "PREFERS" instead of "HAS", but is
> there any real reason to do that?
>
> Do we suddenly expect that people would make a CPU that has native
> acquire/release, and it would somehow then prefer a full read barrier?

ARCH_HAS_ACQUIRE_RELEASE is fine, but the help text for this Kconfig option should clarify this preference as both the ARCH_HAS_ACQUIRE_RELEASE and the !ARCH_HAS_ACQUIRE_RELEASE code are valid.

Cheers,
Longman



  reply	other threads:[~2024-08-13 20:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 18:26 Christoph Lameter via B4 Relay
2024-08-13 19:01 ` Waiman Long
2024-08-13 19:41   ` Christoph Lameter (Ampere)
2024-08-13 19:48   ` Linus Torvalds
2024-08-13 19:58     ` Waiman Long
2024-08-13 20:01       ` Linus Torvalds
2024-08-13 20:23         ` Waiman Long [this message]
2024-08-19  8:45 ` Mark Rutland
2024-08-19 16:25   ` Linus Torvalds

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=b770230f-7721-461b-a9f8-b482284c4a94@redhat.com \
    --to=longman@redhat.com \
    --cc=boqun.feng@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=cl@gentwo.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --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