# git rev-parse -q --verify 3a7e02c040b130b5545e4b115aada7bacd80a2b6^{commit} # git fetch -q -n -f git://fs.ozlabs.ibm.com/kernel/linus master # git rev-parse -q --verify 3a7e02c040b130b5545e4b115aada7bacd80a2b6^{commit} 3a7e02c040b130b5545e4b115aada7bacd80a2b6 # 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/korg/gcc-13.1.0-nolibc/sparc64-linux/bin/sparc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sparc64-linux/bin/sparc64-linux-ld --version # < git log --format=%s --max-count=1 3a7e02c040b130b5545e4b115aada7bacd80a2b6 # make -s -j 160 ARCH=sparc64 O=/kisskb/build/linus_allmodconfig_sparc64-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sparc64-linux/bin/sparc64-linux- allmodconfig # < make -s -j 160 ARCH=sparc64 O=/kisskb/build/linus_allmodconfig_sparc64-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sparc64-linux/bin/sparc64-linux- help # make -s -j 160 ARCH=sparc64 O=/kisskb/build/linus_allmodconfig_sparc64-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sparc64-linux/bin/sparc64-linux- olddefconfig # make -s -j 160 ARCH=sparc64 O=/kisskb/build/linus_allmodconfig_sparc64-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sparc64-linux/bin/sparc64-linux- :1519:2: warning: #warning syscall clone3 not implemented [-Wcpp] /kisskb/src/arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes] 254 | __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts) | ^~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype for '__vdso_clock_gettime_stick' [-Werror=missing-prototypes] 282 | __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes] 307 | __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) | ^~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype for '__vdso_gettimeofday_stick' [-Werror=missing-prototypes] 343 | __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz) | ^~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[5]: *** [/kisskb/src/scripts/Makefile.build:244: arch/sparc/vdso/vclock_gettime.o] Error 1 make[4]: *** [/kisskb/src/scripts/Makefile.build:485: arch/sparc/vdso] Error 2 make[4]: *** Waiting for unfinished jobs.... /kisskb/src/kernel/fork.c: In function '__do_sys_clone3': /kisskb/src/kernel/fork.c:3072:2: error: #warning clone3() entry point is missing, please fix [-Werror=cpp] 3072 | #warning clone3() entry point is missing, please fix | ^~~~~~~ cc1: all warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:244: kernel/fork.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:485: arch/sparc] Error 2 make[3]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:485: kernel] Error 2 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 160 ARCH=sparc64 O=/kisskb/build/linus_allmodconfig_sparc64-gcc13 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-13.1.0-nolibc/sparc64-linux/bin/sparc64-linux- ' returned non-zero exit status 2. # rm -rf /kisskb/build/linus_allmodconfig_sparc64-gcc13 # Build took: 0:12:29.892603