# git rev-parse -q --verify 3a7e02c040b130b5545e4b115aada7bacd80a2b6^{commit} 3a7e02c040b130b5545e4b115aada7bacd80a2b6 already have revision, skipping fetch # git checkout -q -f -B kisskb 3a7e02c040b130b5545e4b115aada7bacd80a2b6 # git clean -qxdf # < git log -1 # commit 3a7e02c040b130b5545e4b115aada7bacd80a2b6 # Author: Linus Torvalds # Date: Fri Jul 26 15:32:27 2024 -0700 # # minmax: avoid overly complicated constant expressions in VM code # # The minmax infrastructure is overkill for simple constants, and can # cause huge expansions because those simple constants are then used by # other things. # # For example, 'pageblock_order' is a core VM constant, but because it was # implemented using 'min_t()' and all the type-checking that involves, it # actually expanded to something like 2.5kB of preprocessor noise. # # And when that simple constant was then used inside other expansions: # # #define pageblock_nr_pages (1UL << pageblock_order) # #define pageblock_start_pfn(pfn) ALIGN_DOWN((pfn), pageblock_nr_pages) # # and we then use that inside a 'max()' macro: # # case ISOLATE_SUCCESS: # update_cached = false; # last_migrated_pfn = max(cc->zone->zone_start_pfn, # pageblock_start_pfn(cc->migrate_pfn - 1)); # # the end result was that one statement expanding to 253kB in size. # # There are probably other cases of this, but this one case certainly # stood out. # # I've added 'MIN_T()' and 'MAX_T()' macros for this kind of "core simple # constant with specific type" use. These macros skip the type checking, # and as such need to be very sparingly used only for obvious cases that # have active issues like this. # # Reported-by: Lorenzo Stoakes # Link: https://lore.kernel.org/all/36aa2cad-1db1-4abf-8dd2-fb20484aabc3@lucifer.local/ # Cc: David Laight # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 3a7e02c040b130b5545e4b115aada7bacd80a2b6 # make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 allyesconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_KCOV=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=n # Added to kconfig CONFIG_GCC_PLUGIN_SANCOV=n # Added to kconfig CONFIG_GCC_PLUGIN_LATENT_ENTROPY=n # Added to kconfig CONFIG_GCC_PLUGIN_STRUCTLEAK=n # Added to kconfig CONFIG_GCC_PLUGIN_RANDSTRUCT=n # Added to kconfig CONFIG_UML_NET=n # Added to kconfig CONFIG_UML_NET_ETHERTAP=n # Added to kconfig CONFIG_UML_NET_TUNTAP=n # Added to kconfig CONFIG_UML_NET_SLIP=n # Added to kconfig CONFIG_UML_NET_DAEMON=n # Added to kconfig CONFIG_UML_NET_VDE=n # Added to kconfig CONFIG_UML_NET_MCAST=n # Added to kconfig CONFIG_UML_NET_PCAP=n # Added to kconfig CONFIG_UML_NET_SLIRP=n # Added to kconfig CONFIG_GCOV_KERNEL=n # Added to kconfig CONFIG_DEBUG_INFO_BTF=n # Added to kconfig CONFIG_BPF_PRELOAD=n # Added to kconfig CONFIG_SPI_STM32_QSPI=n # < make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 help # make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 olddefconfig .config:14987:warning: override: reassigning to symbol GCC_PLUGIN_LATENT_ENTROPY .config:14991:warning: override: reassigning to symbol UML_NET_ETHERTAP .config:14993:warning: override: reassigning to symbol UML_NET_SLIP .config:14998:warning: override: reassigning to symbol UML_NET_SLIRP # make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 /kisskb/src/lib/iomap.c:156:5: error: no previous prototype for ‘ioread64_lo_hi’ [-Werror=missing-prototypes] 156 | u64 ioread64_lo_hi(const void __iomem *addr) | ^~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:163:5: error: no previous prototype for ‘ioread64_hi_lo’ [-Werror=missing-prototypes] 163 | u64 ioread64_hi_lo(const void __iomem *addr) | ^~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:170:5: error: no previous prototype for ‘ioread64be_lo_hi’ [-Werror=missing-prototypes] 170 | u64 ioread64be_lo_hi(const void __iomem *addr) | ^~~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:178:5: error: no previous prototype for ‘ioread64be_hi_lo’ [-Werror=missing-prototypes] 178 | u64 ioread64be_hi_lo(const void __iomem *addr) | ^~~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:264:6: error: no previous prototype for ‘iowrite64_lo_hi’ [-Werror=missing-prototypes] 264 | void iowrite64_lo_hi(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:272:6: error: no previous prototype for ‘iowrite64_hi_lo’ [-Werror=missing-prototypes] 272 | void iowrite64_hi_lo(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:280:6: error: no previous prototype for ‘iowrite64be_lo_hi’ [-Werror=missing-prototypes] 280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~~~ /kisskb/src/lib/iomap.c:288:6: error: no previous prototype for ‘iowrite64be_hi_lo’ [-Werror=missing-prototypes] 288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:244: lib/iomap.o] Error 1 make[3]: *** [/kisskb/src/scripts/Makefile.build:485: lib] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/kisskb/src/Makefile:1926: .] Error 2 make[1]: *** [/kisskb/src/Makefile:224: __sub-make] Error 2 make: *** [Makefile:224: __sub-make] Error 2 Command 'make -s -j 32 ARCH=um O=/kisskb/build/linus_allyesconfig_um-x86_64-gcc12 CROSS_COMPILE=/opt/cross/kisskb/x86-64--glibc--bleeding-edge-2022.08-1/bin/x86_64-linux- SUBARCH=x86_64 ' returned non-zero exit status 2. # rm -rf /kisskb/build/linus_allyesconfig_um-x86_64-gcc12 # Build took: 0:20:11.162703