From: "Jürgen Groß" <jgross@suse.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
david.laight@aculab.com, Arnd Bergmann <arnd@kernel.org>,
willy@infradead.org, torvalds@linux-foundation.org,
Jason@zx2c4.com, hch@infradead.org,
andriy.shevchenko@linux.intel.com, pedro.falcato@gmail.com,
Mateusz Guzik <mjguzik@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: Build performance regressions originating from min()/max() macros
Date: Wed, 24 Jul 2024 11:40:07 +0200 [thread overview]
Message-ID: <0b11e6c8-170d-4b95-ad14-76685d657643@suse.com> (raw)
In-Reply-To: <9d62cd2d-a00b-4260-8ffb-0e0e4574f222@lucifer.local>
On 24.07.24 10:31, Lorenzo Stoakes wrote:
> On Wed, Jul 24, 2024 at 10:14:12AM GMT, Jürgen Groß wrote:
>> On 23.07.24 23:59, Lorenzo Stoakes wrote:
>>> Arnd reported a significant build slowdown [0], which was bisected to the
>>> series spanning commit 80fcac55385c ("minmax: relax check to allow
>>> comparison between unsigned arguments and signed constants") to commit
>>> 867046cc70277 ("minmax: relax check to allow comparison between unsigned
>>> arguments and signed constants"), originating from the series "minmax:
>>> Relax type checks in min() and max()." [1].
>
> [snip]
>
>> I can send a patch to simplify the problematic construct, but OTOH this
>> will avoid only one particularly bad example.
>
> Thanks, appreciated but I am a little concerned that we might get stuck in
> whack-a-mole here a bit. I'm pretty sure we've had previous patches that
> have addressed invocation points, but obviously the underlying issue are
> these macros which will keep cropping up again and again.
The xen example seems to be one of the worst due to nesting of min3() and
min(), so being de facto a min4().
I think drivers/firmware/sysfb_simplefb.c has a similar problem, as it is
nesting max() with max3(). Same applies to arch/x86/kernel/cpu/cacheinfo.c
and multiple times to fs/xfs/libxfs/xfs_trans_resv.c.
There are probably more such extreme cases.
Juergen
next prev parent reply other threads:[~2024-07-24 9:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 21:59 Lorenzo Stoakes
2024-07-24 8:14 ` Jürgen Groß
2024-07-24 8:31 ` Lorenzo Stoakes
2024-07-24 9:40 ` Jürgen Groß [this message]
2024-07-24 9:43 ` Lorenzo Stoakes
2024-07-24 14:47 ` David Laight
2024-07-24 8:34 ` David Laight
2024-07-24 8:50 ` Arnd Bergmann
2024-07-24 8:44 ` Lorenzo Stoakes
2024-07-24 11:05 ` David Laight
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=0b11e6c8-170d-4b95-ad14-76685d657643@suse.com \
--to=jgross@suse.com \
--cc=Jason@zx2c4.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@kernel.org \
--cc=david.laight@aculab.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mjguzik@gmail.com \
--cc=pedro.falcato@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.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