# git rev-parse -q --verify a6fcdbf95d7907bc5d5a669adb86e6bda72d738b^{commit} a6fcdbf95d7907bc5d5a669adb86e6bda72d738b already have revision, skipping fetch # git checkout -q -f -B kisskb a6fcdbf95d7907bc5d5a669adb86e6bda72d738b # git clean -qxdf # < git log -1 # commit a6fcdbf95d7907bc5d5a669adb86e6bda72d738b # Author: Reza Arbab # Date: Thu Aug 2 23:03:36 2018 -0500 # # powerpc/powernv: Fix concurrency issue with npu->mmio_atsd_usage # # We've encountered a performance issue when multiple processors stress # {get,put}_mmio_atsd_reg(). These functions contend for # mmio_atsd_usage, an unsigned long used as a bitmask. # # The accesses to mmio_atsd_usage are done using test_and_set_bit_lock() # and clear_bit_unlock(). As implemented, both of these will require # a (successful) stwcx to that same cache line. # # What we end up with is thread A, attempting to unlock, being slowed by # other threads repeatedly attempting to lock. A's stwcx instructions # fail and retry because the memory reservation is lost every time a # different thread beats it to the punch. # # There may be a long-term way to fix this at a larger scale, but for # now resolve the immediate problem by gating our call to # test_and_set_bit_lock() with one to test_bit(), which is obviously # implemented without using a store. # # Fixes: 1ab66d1fbada ("powerpc/powernv: Introduce address translation services for Nvlink2") # Signed-off-by: Reza Arbab # Acked-by: Alistair Popple # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < git log --format=%s --max-count=1 a6fcdbf95d7907bc5d5a669adb86e6bda72d738b # < make -s -j 10 ARCH=powerpc O=/kisskb/build/powerpc-next_44x_akebono_defconfig_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- 44x/akebono_defconfig # make -s -j 10 ARCH=powerpc O=/kisskb/build/powerpc-next_44x_akebono_defconfig_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/net/Makefile:24: CC cannot link executables. Skipping bpfilter. /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:183:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c: In function 'init_srcu_struct_fields': /kisskb/src/kernel/rcu/srcutree.c:146:32: warning: 'levelspread[]' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c:94:6: note: 'levelspread[]' was declared here /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:339:21: note: 'pdeo' was declared here /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2497:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1819:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/Makefile:24: CC cannot link executables. Skipping bpfilter. /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'univ8250_release_irq': /kisskb/src/drivers/tty/serial/8250/8250_core.c:251:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c:231:19: note: 'i' was declared here arch/powerpc/boot/akebono.dtb: Warning (pci_bridge): /plb/pciex@10100000000: node name is not "pci" or "pcie" arch/powerpc/boot/akebono.dtb: Warning (pci_bridge): /plb/pciex@20100000000: node name is not "pci" or "pcie" arch/powerpc/boot/akebono.dtb: Warning (pci_bridge): /plb/pciex@18100000000: node name is not "pci" or "pcie" arch/powerpc/boot/akebono.dtb: Warning (pci_bridge): /plb/pciex@28100000000: node name is not "pci" or "pcie" arch/powerpc/boot/akebono.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge' Completed OK # rm -rf /kisskb/build/powerpc-next_44x_akebono_defconfig_powerpc # Build took: 0:01:02.868803