All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
	"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 21:08:05 +0200	[thread overview]
Message-ID: <ZPYrFeAzWjESRiJD@gmail.com> (raw)
In-Reply-To: <20230904131853.GA12042@noisy.programming.kicks-ass.net>


* Peter Zijlstra <peterz@infradead.org> wrote:

> 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).

The changelog of the patch should probably include before/after generated 
code comparison & analysis - or at minimum a '/bin/size' comparison to 
quantify the changes to generated code.

Thanks,

	Ingo

      reply	other threads:[~2023-09-04 19:08 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
2023-09-04 19:08   ` Ingo Molnar [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=ZPYrFeAzWjESRiJD@gmail.com \
    --to=mingo@kernel.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=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 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.