mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Magnus Lindholm <linmag7@gmail.com>
To: davem@davemloft.net, andreas@gaisler.com
Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
	linmag7@gmail.com
Subject: [PATCH 0/1] sparc32: prevent stale writes by failed bit-lock waiters
Date: Mon, 26 Oct 2026 09:36:55 +0100	[thread overview]
Message-ID: <20261026083837.1055953-1-linmag7@gmail.com> (raw)

I traced an SMP HyperSPARC pathname-lookup livelock to a failed bit-lock
waiter restoring an unlinked dentry. Skip unchanged stores in the SPARC32
emulated atomics and bit helpers, without changing generic bitops or ABI.

For background, PA-RISC made test-and-set/clear conditional in 2006
(af5917f0cd60). The 2018 generic rewrite (84c6591103db) routed bit locks
through atomic_fetch_*(), which needs the same unchanged-store rule.
I keep this fix within arch/sparc; PA-RISC's fetch helpers need separate
review and are outside this patch's scope. The SPARC32 fetch helpers,
including fetch-add, gain a comparison; I claim no performance improvement.

The forced-interleaving host test reproduces the old lost update and
checks the corrected generic acquisition path. SMP and UP builds and
QEMU smoke tests passed for the architecture-only implementation.

I completed a native GDB 18.1 build on a dual-CPU HyperSPARC RT626
SPARCstation 20 with 512 MB RAM and a native SPARC32 SMP kernel containing
the combined fixes and optimizations, plus separate platform prerequisites.
I observed no core dumps, livelock or new kernel messages during the run.
This validates the combined integration, not each patch in isolation.

Magnus Lindholm (1):
  sparc32: do not write back unchanged values in emulated atomics

 arch/sparc/lib/atomic32.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)


base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
-- 
2.43.0


             reply	other threads:[~2026-10-26  8:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26  8:36 Magnus Lindholm [this message]
2026-10-26  8:36 ` [PATCH 1/1] sparc32: do not write back unchanged values in emulated atomics Magnus Lindholm

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=20261026083837.1055953-1-linmag7@gmail.com \
    --to=linmag7@gmail.com \
    --cc=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.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®