[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230904131853.GA12042@noisy.programming.kicks-ass.net>
Date: Mon, 4 Sep 2023 15:18:53 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc: Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] locking/mutex: remove redundant argument from
__mutex_lock_common()
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).
Powered by blists - more mailing lists