public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] locking/mutex: remove redundant argument from __mutex_lock_common()
Date: Mon, 4 Sep 2023 15:18:53 +0200	[thread overview]
Message-ID: <20230904131853.GA12042@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <49c7163433999cc1fc9367311fbe6c6d5fd9f251.1693693823.git.mirq-linux@rere.qmqm.pl>

On Sun, Sep 03, 2023 at 12:33:19AM +0200, Michał Mirosław wrote:
> use_ww_ctx is equivalent to ww_ctx != NULL. The one case where
> use_ww_ctx was true but ww_ctx == NULL leads to the same
> __mutex_add_waiter() call via __ww_mutex_add_waiter().
> 
> Since now __ww_mutex_add_waiter() is called only with ww_ctx != NULL
> (from both regular and PREEMPT_RT implementations), remove the
> branch there.
> 

There were compilers that failed to constant propagate the ww_ctx==NULL
thing properly and generated crap code, the use_ww_ctx thing fixed that.

I can't remember which compilers that were (my brain is saying <gcc-6 or
something, but I could be totally wrong) and if we still care about
people using them (probably not).


  reply	other threads:[~2023-09-04 13:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-02 22:33 [PATCH v2] locking/mutex: remove redundant argument from __mutex_lock_common() Michał Mirosław
2023-09-04 13:18 ` Peter Zijlstra [this message]
2023-09-04 19:08   ` Ingo Molnar

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=20230904131853.GA12042@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --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