All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Waiman Long <longman@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Boqun Feng <boqun@kernel.org>,
	linux-kernel@vger.kernel.org, Davidlohr Bueso <dave@stgolabs.net>,
	Haakon Bugge <haakon.bugge@oracle.com>,
	David Laight <david.laight.linux@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Yafang Shao <laoar.shao@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v3] locking/osq_lock: Ensure proper locking semantics for osq_lock/osq_unlock()
Date: Wed, 16 Sep 2026 09:46:56 +0200	[thread overview]
Message-ID: <20260916074656.GL4120091@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <89a400fa-f23d-41d4-9a82-df8697eed0b3@redhat.com>

On Tue, Sep 15, 2026 at 01:53:05PM -0400, Waiman Long wrote:

> In your comment to David's "locking/osq_lock: Set prev_cpu=0 instead of
> locked=1" patch, you suggested adding smp_acquire__after_ctrl_dep() after
> finding that the lock had been granted which is exactly what the change from
> smp_cond_load_relaxed() to smp_cond_load_acquire() is doing. Right?

It is similar, yes.

But all I did there was restore an ACQUIRE that David lost, silently.
That loop exit condition was smp_load_acquire() and he made it go away.

Now, you're right in that we can probably survive making it
smp_cond_load_acquire(). However:

 - you get to re-run the numbers from 036cc30c6b6a to show it doesn't
   regress

 - you don't put on Fixes, *unless* you put in a solid argument showing
   what is broken how. And so far, nothing actually needs this ordering
   because osq isn't actually a stand-alone lock -- it was never meant
   to be.

      parent reply	other threads:[~2026-09-16  7:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 20:21 [PATCH v3] locking/osq_lock: Ensure proper locking semantics for osq_lock/osq_unlock() Waiman Long
2026-09-15  8:26 ` Peter Zijlstra
2026-09-15 17:53   ` Waiman Long
2026-09-15 18:08     ` David Laight
2026-09-15 20:29       ` Waiman Long
2026-09-16  7:33     ` Peter Zijlstra
2026-09-16  7:46     ` Peter Zijlstra [this message]

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=20260916074656.GL4120091@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=boqun@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=david.laight.linux@gmail.com \
    --cc=haakon.bugge@oracle.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.