David Howells wrote on Tue, Aug 12, 2025 at 10:38:31PM +0100:
26923 1104 0 28027 6d7b a.o 27019 1104 0 28123 6ddb b.o
That's a surprisingly large change.
Right, because the function is inlined multiple times in iov_iter.o it turned out rather big... Here's what it looks like from busybox's bloat-o-meter, which gives a better picture:
function old new delta iov_iter_zero 1706 1738 +32 copy_page_to_iter_nofault 2491 2512 +21 _copy_mc_to_iter 1604 1624 +20 copy_folio_from_iter_atomic 2620 2633 +13 _copy_from_iter_nocache 1706 1719 +13 _copy_from_iter_flushcache 1409 1422 +13 _copy_to_iter 1885 1891 +6 _copy_from_iter 1874 1880 +6 iov_iter_extract_pages 2182 2166 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/1 up/down: 124/-16) Total: 108 bytes
So the compiler obviously doesn't optimize the if (at least with whatever default flags I'm using on gcc 15.2.1), but the impact is only that big because it's copied so many times.
Anyway, as said before I'm happy to prioritize readability here, so sending a v3 with just this changed.