# git rev-parse -q --verify 981ee95cc1f5905ae4936b0dd501085909cdc14f^{commit} 981ee95cc1f5905ae4936b0dd501085909cdc14f already have revision, skipping fetch # git checkout -q -f -B kisskb 981ee95cc1f5905ae4936b0dd501085909cdc14f # git clean -qxdf # < git log -1 # commit 981ee95cc1f5905ae4936b0dd501085909cdc14f # Author: Mateusz Guzik # Date: Wed Jan 25 16:55:57 2023 +0100 # # vfs: avoid duplicating creds in faccessat if possible # # access(2) remains commonly used, for example on exec: # access("/etc/ld.so.preload", R_OK) # # or when running gcc: strace -c gcc empty.c # # % time seconds usecs/call calls errors syscall # ------ ----------- ----------- --------- --------- ---------------- # 0.00 0.000000 0 42 26 access # # It falls down to do_faccessat without the AT_EACCESS flag, which in turn # results in allocation of new creds in order to modify fsuid/fsgid and # caps. This is a very expensive process single-threaded and most notably # multi-threaded, with numerous structures getting refed and unrefed on # imminent new cred destruction. # # Turns out for typical consumers the resulting creds would be identical # and this can be checked upfront, avoiding the hard work. # # An access benchmark plugged into will-it-scale running on Cascade Lake # shows: # # test proc before after # access1 1 1310582 2908735 (+121%) # distinct files # access1 24 4716491 63822173 (+1353%) # distinct files # access2 24 2378041 5370335 (+125%) # same file # # The above benchmarks are not integrated into will-it-scale, but can be # found in a pull request: # # https://github.com/antonblanchard/will-it-scale/pull/36/files # # Signed-off-by: Mateusz Guzik # Cc: Al Viro # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 981ee95cc1f5905ae4936b0dd501085909cdc14f # < make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 allmodconfig # 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 # < make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 help # make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 olddefconfig .config:12704:warning: override: reassigning to symbol GCC_PLUGIN_SANCOV .config:12709:warning: override: reassigning to symbol UML_NET_ETHERTAP .config:12711:warning: override: reassigning to symbol UML_NET_SLIP .config:12714:warning: override: reassigning to symbol UML_NET_MCAST .config:12716:warning: override: reassigning to symbol UML_NET_SLIRP # make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 /kisskb/src/arch/um/os-Linux/util.c:17:24: fatal error: sys/random.h: No such file or directory compilation terminated. make[3]: *** [/kisskb/src/scripts/Makefile.build:252: arch/um/os-Linux/util.o] Error 1 make[2]: *** [/kisskb/src/scripts/Makefile.build:494: arch/um/os-Linux] Error 2 make[2]: *** Waiting for unfinished jobs.... /kisskb/src/fs/btrfs/send.c: In function 'get_cur_inode_state': /kisskb/src/fs/btrfs/send.c:1909:13: error: 'right_gen' may be used uninitialized in this function [-Werror=maybe-uninitialized] } else if (right_gen == gen) { ^ /kisskb/src/fs/btrfs/send.c: At top level: cc1: error: unrecognized command line option '-Wno-shift-negative-value' [-Werror] cc1: all warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:252: fs/btrfs/send.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:494: fs/btrfs] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/kisskb/src/scripts/Makefile.build:494: fs] Error 2 In file included from /kisskb/src/arch/x86/um/asm/processor.h:41:0, from /kisskb/src/include/linux/mutex.h:19, from /kisskb/src/include/linux/kernfs.h:11, from /kisskb/src/include/linux/sysfs.h:16, from /kisskb/src/include/linux/kobject.h:20, from /kisskb/src/include/linux/pci.h:35, from /kisskb/src/drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:26: /kisskb/src/drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c: In function 'kfd_cpumask_to_apic_id': /kisskb/src/arch/um/include/asm/processor-generic.h:94:18: error: called object is not a function or function pointer #define cpu_data (&boot_cpu_data) ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:2157:9: note: in expansion of macro 'cpu_data' return cpu_data(first_cpu_of_numa_node).apicid; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:2161:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: all warnings being treated as errors make[6]: *** [/kisskb/src/scripts/Makefile.build:252: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.o] Error 1 make[6]: *** Waiting for unfinished jobs.... make[5]: *** [/kisskb/src/scripts/Makefile.build:494: drivers/gpu/drm/amd/amdgpu] Error 2 make[5]: *** Waiting for unfinished jobs.... make[4]: *** [/kisskb/src/scripts/Makefile.build:494: drivers/gpu/drm] Error 2 make[3]: *** [/kisskb/src/scripts/Makefile.build:494: drivers/gpu] Error 2 make[2]: *** [/kisskb/src/scripts/Makefile.build:494: drivers] Error 2 make[1]: *** [/kisskb/src/Makefile:2028: .] Error 2 make: *** [Makefile:226: __sub-make] Error 2 Command 'make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_um-allmodconfig_um-x86_64 # Build took: 0:11:38.548241