mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Glaser <t.glaser@tarent.de>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org, ardb@kernel.org, arnd@arndb.de,
	boqun.feng@gmail.com, peterz@infradead.org, will@kernel.org
Subject: Re: [PATCH v2] atomics: fix atomic64_{read_acquire,set_release} fallbacks
Date: Sat, 5 Nov 2022 00:05:30 +0100 (CET)	[thread overview]
Message-ID: <fcafd6d9-7d3e-67b0-3176-5fb8e9c322ef@tarent.de> (raw)
In-Reply-To: <20220203161243.3955547-1-mark.rutland@arm.com>

On Thu, 3 Feb 2022, Mark Rutland wrote:

> -	smp_store_release(&(v)->counter, i);
> +	if (__native_word(atomic_t)) {
> +		smp_store_release(&(v)->counter, i);
> +	} else {
> +		__atomic_release_fence();
> +		arch_atomic_set(v, i);
> +	}

Shouldn’t this also update Documentation/atomic_t.txt which
currently states:

| The non-RMW ops are (typically) regular LOADs and STOREs and are canonically
| implemented using READ_ONCE(), WRITE_ONCE(), smp_load_acquire() and
| smp_store_release() respectively. Therefore, if you find yourself only using
| the Non-RMW operations of atomic_t, you do not in fact need atomic_t at all
| and are doing it wrong.

With this, direct use of atomic64_set_release() and atomic64_read_acquire()
is (IIUC) not “doing it wrong” any more?

bye,
//mirabilos
-- 
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

                        ****************************************************
/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against      Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also,     https://www.tarent.de/newsletter
╱ ╲ header encryption!
                        ****************************************************

  parent reply	other threads:[~2022-11-04 23:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 16:12 Mark Rutland
2022-02-03 16:18 ` Ard Biesheuvel
2022-02-04  0:20 ` Boqun Feng
2022-02-04 11:16   ` Mark Rutland
2022-02-04 15:45     ` Boqun Feng
2022-02-06 14:06     ` Peter Zijlstra
2022-11-04 23:05 ` Thorsten Glaser [this message]
2022-11-07 10:37   ` Mark Rutland
2022-11-07 11:14     ` Thorsten Glaser

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=fcafd6d9-7d3e-67b0-3176-5fb8e9c322ef@tarent.de \
    --to=t.glaser@tarent.de \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®