[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40369e153bd447e5b597c31e7bc9a2b1@AcuMS.aculab.com>
Date: Sat, 27 Jul 2024 08:08:39 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Linus Torvalds' <torvalds@...uxfoundation.org>, Lorenzo Stoakes
<lorenzo.stoakes@...cle.com>, Jens Axboe <axboe@...nel.dk>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Matthew
Wilcox (Oracle)" <willy@...radead.org>, Christoph Hellwig
<hch@...radead.org>, Andrew Morton <akpm@...ux-foundation.org>, "Andy
Shevchenko" <andriy.shevchenko@...ux.intel.com>, Dan Carpenter
<dan.carpenter@...aro.org>, Arnd Bergmann <arnd@...nel.org>,
"Jason@...c4.com" <Jason@...c4.com>, "pedro.falcato@...il.com"
<pedro.falcato@...il.com>, Mateusz Guzik <mjguzik@...il.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: RE: [PATCH 0/7] minmax: reduce compilation time
...
> and it will spit out
>
> Longest line is drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:1136 (2346kB)
> ' ((((((pkt_size) + __builtin_choose_expr((sizeof(int) ==
> sizeof(*(8 ? ((void *)((long)((__builtin_...'
>
> to tell me that we have that insane 2.2 *megabyte* line due to the
> MVPP2_SKB_HEADROOM thing, and I should apply this patch:
>
> -#define MVPP2_SKB_HEADROOM min(max(XDP_PACKET_HEADROOM, NET_SKB_PAD), 224)
> +#define MVPP2_SKB_HEADROOM
> MIN_T(int,MAX_T(int,XDP_PACKET_HEADROOM, NET_SKB_PAD), 224)
>
> to fix it.
Or (if I've got is right):
#define MVPP2_SKB_HEADROOM clamp(XDP_PACKET_HEADROOM, NET_SKB_PAD, 224)
Hmmm...
I've found:
#define XDP_PACKET_HEADROOM 256
#define NET_SKB_PAD max(32, L1_CACHE_BYTES)
I'd bet that some architecture even has a non-constant L1_CACHE_BYTES.
But the 256 means the headroom is always 224 (whatever that limit is related to).
It is definitely worth freeing up MIN() and MAX() for:
#define MIN(x, y) ( \
BUILD_BUG_ON_ZERO(__is_constexpr((x) + (y)) + ((x) < (y) ? (x) : (y)))
which is then usable for static initialisers.
Just assuming that no one is silly enough to get a negative constant
compared to an unsigned value.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists