# git rev-parse -q --verify 80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6^{commit} 80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 already have revision, skipping fetch # git checkout -q -f -B kisskb 80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 # git clean -qxdf # < git log -1 # commit 80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 # Author: Linus Torvalds # Date: Thu Feb 17 08:57:47 2022 -0800 # # mm: don't try to NUMA-migrate COW pages that have other uses # # Oded Gabbay reports that enabling NUMA balancing causes corruption with # his Gaudi accelerator test load: # # "All the details are in the bug, but the bottom line is that somehow, # this patch causes corruption when the numa balancing feature is # enabled AND we don't use process affinity AND we use GUP to pin pages # so our accelerator can DMA to/from system memory. # # Either disabling numa balancing, using process affinity to bind to # specific numa-node or reverting this patch causes the bug to # disappear" # # and Oded bisected the issue to commit 09854ba94c6a ("mm: do_wp_page() # simplification"). # # Now, the NUMA balancing shouldn't actually be changing the writability # of a page, and as such shouldn't matter for COW. But it appears it # does. Suspicious. # # However, regardless of that, the condition for enabling NUMA faults in # change_pte_range() is nonsensical. It uses "page_mapcount(page)" to # decide if a COW page should be NUMA-protected or not, and that makes # absolutely no sense. # # The number of mappings a page has is irrelevant: not only does GUP get a # reference to a page as in Oded's case, but the other mappings migth be # paged out and the only reference to them would be in the page count. # # Since we should never try to NUMA-balance a page that we can't move # anyway due to other references, just fix the code to use 'page_count()'. # Oded confirms that that fixes his issue. # # Now, this does imply that something in NUMA balancing ends up changing # page protections (other than the obvious one of making the page # inaccessible to get the NUMA faulting information). Otherwise the COW # simplification wouldn't matter - since doing the GUP on the page would # make sure it's writable. # # The cause of that permission change would be good to figure out too, # since it clearly results in spurious COW events - but fixing the # nonsensical test that just happened to work before is obviously the # CorrectThing(tm) to do regardless. # # Fixes: 09854ba94c6a ("mm: do_wp_page() simplification") # Link: https://bugzilla.kernel.org/show_bug.cgi?id=215616 # Link: https://lore.kernel.org/all/CAFCwf10eNmwq2wD71xjUhqkvv5+_pJMR1nPug2RqNDcFT4H86Q@mail.gmail.com/ # Reported-and-tested-by: Oded Gabbay # Cc: David Hildenbrand # Cc: Peter Xu # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-11.1.0-nolibc/xtensa-linux/bin/xtensa-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-11.1.0-nolibc/xtensa-linux/bin/xtensa-linux-ld --version # < git log --format=%s --max-count=1 80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 # < make -s -j 48 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/xtensa-linux/bin/xtensa-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # < make -s -j 48 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/xtensa-linux/bin/xtensa-linux- help # make -s -j 48 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/xtensa-linux/bin/xtensa-linux- olddefconfig # make -s -j 48 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/xtensa-linux/bin/xtensa-linux- /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi:11.18-14.6: Warning (unit_address_format): /soc/flash@08000000/partition@0x0: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi:15.23-18.6: Warning (unit_address_format): /soc/flash@08000000/partition@0x400000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi:19.23-22.6: Warning (unit_address_format): /soc/flash@08000000/partition@0xa00000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi:23.23-26.6: Warning (unit_address_format): /soc/flash@08000000/partition@0xfe0000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi:11.18-14.6: Warning (unit_address_format): /soc/flash@08000000/partition@0x0: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi:15.23-18.6: Warning (unit_address_format): /soc/flash@08000000/partition@0x3f0000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi:11.18-14.6: Warning (unit_address_format): /soc/flash@00000000/partition@0x0: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi:15.24-18.6: Warning (unit_address_format): /soc/flash@00000000/partition@0x6000000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi:19.24-22.6: Warning (unit_address_format): /soc/flash@00000000/partition@0x6800000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi:23.24-26.6: Warning (unit_address_format): /soc/flash@00000000/partition@0x7fe0000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi:11.18-14.6: Warning (unit_address_format): /soc/flash@00000000/partition@0x0: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi:15.24-18.6: Warning (unit_address_format): /soc/flash@00000000/partition@0x6000000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi:19.24-22.6: Warning (unit_address_format): /soc/flash@00000000/partition@0x6800000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi:23.24-26.6: Warning (unit_address_format): /soc/flash@00000000/partition@0x7fe0000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi:11.18-14.6: Warning (unit_address_format): /soc/flash@08000000/partition@0x0: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi:15.23-18.6: Warning (unit_address_format): /soc/flash@08000000/partition@0x400000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi:19.23-22.6: Warning (unit_address_format): /soc/flash@08000000/partition@0xa00000: unit name should not have leading "0x" /kisskb/src/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi:23.23-26.6: Warning (unit_address_format): /soc/flash@08000000/partition@0xfe0000: unit name should not have leading "0x" WARNING: modpost: vmlinux.o(.text.unlikely+0x4540): Section mismatch in reference from the function __trace_event_discard_commit() to the variable .init.data:initcall_level_names The function __trace_event_discard_commit() references the variable __initdata initcall_level_names. This is often because __trace_event_discard_commit lacks a __initdata annotation or the annotation of initcall_level_names is wrong. WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14410): Section mismatch in reference from the variable qed_mfw_legacy_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_legacy_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14428): Section mismatch in reference from the variable qed_mfw_legacy_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_legacy_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14440): Section mismatch in reference from the variable qed_mfw_legacy_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_legacy_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14458): Section mismatch in reference from the variable qed_mfw_legacy_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_legacy_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14470): Section mismatch in reference from the variable qed_mfw_legacy_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_legacy_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14488): Section mismatch in reference from the variable qed_mfw_legacy_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_legacy_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x144a0): Section mismatch in reference from the variable qed_mfw_legacy_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_legacy_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x144f0): Section mismatch in reference from the variable qed_mfw_ext_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_ext_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14508): Section mismatch in reference from the variable qed_mfw_ext_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_ext_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14520): Section mismatch in reference from the variable qed_mfw_ext_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_ext_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14538): Section mismatch in reference from the variable qed_mfw_ext_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_ext_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14550): Section mismatch in reference from the variable qed_mfw_ext_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_ext_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14568): Section mismatch in reference from the variable qed_mfw_ext_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_ext_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14580): Section mismatch in reference from the variable qed_mfw_ext_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_ext_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qed/qed.o(.data+0x14598): Section mismatch in reference from the variable qed_mfw_ext_maps to the variable .init.rodata:qed_mfw_legacy_bb_100g The variable qed_mfw_ext_maps references the variable __initconst qed_mfw_legacy_bb_100g If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qede/qede.o(.data+0x4790): Section mismatch in reference from the variable qede_forced_speed_maps to the variable .init.rodata:qede_forced_speed_100000 The variable qede_forced_speed_maps references the variable __initconst qede_forced_speed_100000 If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qede/qede.o(.data+0x47a8): Section mismatch in reference from the variable qede_forced_speed_maps to the variable .init.rodata:qede_forced_speed_100000 The variable qede_forced_speed_maps references the variable __initconst qede_forced_speed_100000 If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qede/qede.o(.data+0x47c0): Section mismatch in reference from the variable qede_forced_speed_maps to the variable .init.rodata:qede_forced_speed_100000 The variable qede_forced_speed_maps references the variable __initconst qede_forced_speed_100000 If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qede/qede.o(.data+0x47d8): Section mismatch in reference from the variable qede_forced_speed_maps to the variable .init.rodata:qede_forced_speed_100000 The variable qede_forced_speed_maps references the variable __initconst qede_forced_speed_100000 If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qede/qede.o(.data+0x47f0): Section mismatch in reference from the variable qede_forced_speed_maps to the variable .init.rodata:qede_forced_speed_100000 The variable qede_forced_speed_maps references the variable __initconst qede_forced_speed_100000 If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qede/qede.o(.data+0x4808): Section mismatch in reference from the variable qede_forced_speed_maps to the variable .init.rodata:qede_forced_speed_100000 The variable qede_forced_speed_maps references the variable __initconst qede_forced_speed_100000 If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: modpost: drivers/net/ethernet/qlogic/qede/qede.o(.data+0x4820): Section mismatch in reference from the variable qede_forced_speed_maps to the variable .init.rodata:qede_forced_speed_100000 The variable qede_forced_speed_maps references the variable __initconst qede_forced_speed_100000 If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console Completed OK # rm -rf /kisskb/build/linus_xtensa-allmodconfig_xtensa-gcc11 # Build took: 0:23:06.666113