# git rev-parse -q --verify 225db419ce6a7468e7b219eee8e7ecc1f80f75b2^{commit} 225db419ce6a7468e7b219eee8e7ecc1f80f75b2 already have revision, skipping fetch # git checkout -q -f -B kisskb 225db419ce6a7468e7b219eee8e7ecc1f80f75b2 # git clean -qxdf # < git log -1 # commit 225db419ce6a7468e7b219eee8e7ecc1f80f75b2 # Author: Aneesh Kumar K.V # Date: Mon Jul 29 15:21:28 2019 +0530 # # powerpc/nvdimm: Pick nearby online node if the device node is not online # # Currently, nvdimm subsystem expects the device numa node for SCM device to be # an online node. It also doesn't try to bring the device numa node online. Hence # if we use a non-online numa node as device node we hit crashes like below. This # is because we try to access uninitialized NODE_DATA in different code paths. # # cpu 0x0: Vector: 300 (Data Access) at [c0000000fac53170] # pc: c0000000004bbc50: ___slab_alloc+0x120/0xca0 # lr: c0000000004bc834: __slab_alloc+0x64/0xc0 # sp: c0000000fac53400 # msr: 8000000002009033 # dar: 73e8 # dsisr: 80000 # current = 0xc0000000fabb6d80 # paca = 0xc000000003870000 irqmask: 0x03 irq_happened: 0x01 # pid = 7, comm = kworker/u16:0 # Linux version 5.2.0-06234-g76bd729b2644 (kvaneesh@ltc-boston123) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #135 SMP Thu Jul 11 05:36:30 CDT 2019 # enter ? for help # [link register ] c0000000004bc834 __slab_alloc+0x64/0xc0 # [c0000000fac53400] c0000000fac53480 (unreliable) # [c0000000fac53500] c0000000004bc818 __slab_alloc+0x48/0xc0 # [c0000000fac53560] c0000000004c30a0 __kmalloc_node_track_caller+0x3c0/0x6b0 # [c0000000fac535d0] c000000000cfafe4 devm_kmalloc+0x74/0xc0 # [c0000000fac53600] c000000000d69434 nd_region_activate+0x144/0x560 # [c0000000fac536d0] c000000000d6b19c nd_region_probe+0x17c/0x370 # [c0000000fac537b0] c000000000d6349c nvdimm_bus_probe+0x10c/0x230 # [c0000000fac53840] c000000000cf3cc4 really_probe+0x254/0x4e0 # [c0000000fac538d0] c000000000cf429c driver_probe_device+0x16c/0x1e0 # [c0000000fac53950] c000000000cf0b44 bus_for_each_drv+0x94/0x130 # [c0000000fac539b0] c000000000cf392c __device_attach+0xdc/0x200 # [c0000000fac53a50] c000000000cf231c bus_probe_device+0x4c/0xf0 # [c0000000fac53a90] c000000000ced268 device_add+0x528/0x810 # [c0000000fac53b60] c000000000d62a58 nd_async_device_register+0x28/0xa0 # [c0000000fac53bd0] c0000000001ccb8c async_run_entry_fn+0xcc/0x1f0 # [c0000000fac53c50] c0000000001bcd9c process_one_work+0x46c/0x860 # [c0000000fac53d20] c0000000001bd4f4 worker_thread+0x364/0x5f0 # [c0000000fac53db0] c0000000001c7260 kthread+0x1b0/0x1c0 # [c0000000fac53e20] c00000000000b954 ret_from_kernel_thread+0x5c/0x68 # # The patch tries to fix this by picking the nearest online node as the SCM node. # This does have a problem of us losing the information that SCM node is # equidistant from two other online nodes. If applications need to understand these # fine-grained details we should express then like x86 does via # /sys/devices/system/node/nodeX/accessY/initiators/ # # With the patch we get # # # numactl -H # available: 2 nodes (0-1) # node 0 cpus: # node 0 size: 0 MB # node 0 free: 0 MB # node 1 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 # node 1 size: 130865 MB # node 1 free: 129130 MB # node distances: # node 0 1 # 0: 10 20 # 1: 20 10 # # cat /sys/bus/nd/devices/region0/numa_node # 0 # # dmesg | grep papr_scm # [ 91.332305] papr_scm ibm,persistent-memory:ibm,pmemory@44104001: Region registered with target node 2 and online node 0 # # Signed-off-by: Aneesh Kumar K.V # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/20190729095128.23707-1-aneesh.kumar@linux.ibm.com # < /opt/cross/kisskb/gcc-4.6.3-nolibc/mips-linux/bin/mips-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/mips-linux/bin/mips-linux-ld --version # < git log --format=%s --max-count=1 225db419ce6a7468e7b219eee8e7ecc1f80f75b2 # < make -s -j 120 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mips CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/mips-linux/bin/mips-linux- defconfig # make -s -j 120 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mips CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/mips-linux/bin/mips-linux- /kisskb/src/arch/mips/vdso/Makefile:39: MIPS VDSO requires binutils >= 2.25 :1511:2: warning: #warning syscall clone3 not implemented [-Wcpp] /kisskb/src/arch/mips/vdso/Makefile:39: MIPS VDSO requires binutils >= 2.25 /kisskb/src/kernel/rcu/srcutree.c: In function 'init_srcu_struct_fields': /kisskb/src/kernel/rcu/srcutree.c:140:32: warning: 'levelspread[]' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c:88:6: note: 'levelspread[]' was declared here /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:194:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /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:338:21: note: 'pdeo' was declared here /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1852:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2591:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/bridge/br_netlink.c: In function 'br_afspec.isra.20': /kisskb/src/net/bridge/br_netlink.c:648:7: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'univ8250_release_irq': /kisskb/src/drivers/tty/serial/8250/8250_core.c:248:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c:228:19: note: 'i' was declared here /kisskb/src/net/core/devlink.c: In function 'devlink_fmsg_prepare_skb': /kisskb/src/net/core/devlink.c:4443:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/usb/core/devio.c: In function 'async_completed': /kisskb/src/drivers/usb/core/devio.c:613:23: warning: 'errno' may be used uninitialized in this function [-Wuninitialized] :1511:2: warning: #warning syscall clone3 not implemented [-Wcpp] /kisskb/src/arch/mips/vdso/Makefile:39: MIPS VDSO requires binutils >= 2.25 /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:194:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] FIT description: Linux 5.3.0-rc2-g225db419ce6a Created: Mon Jul 29 22:53:35 2019 Image 0 (kernel@0) Description: Linux 5.3.0-rc2-g225db419ce6a Created: Mon Jul 29 22:53:35 2019 Type: Kernel Image Compression: gzip compressed Data Size: 4526060 Bytes = 4419.98 KiB = 4.32 MiB Architecture: MIPS OS: Linux Load Address: 0x80100000 Entry Point: 0x80860ed0 Hash algo: sha1 Hash value: 88fc6ef5409b8633d869bfc81ff804d4eb73bdb2 Image 1 (fdt@boston) Description: img,boston Device Tree Created: Mon Jul 29 22:53:35 2019 Type: Flat Device Tree Compression: uncompressed Data Size: 3793 Bytes = 3.70 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 4799f50d688573234da6e9d7701234d394759ef4 Image 2 (fdt@ni169445) Description: NI 169445 device tree Created: Mon Jul 29 22:53:35 2019 Type: Flat Device Tree Compression: uncompressed Data Size: 1871 Bytes = 1.83 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 51b89b31605ee62038c8468c429af091dfc75ec7 Image 3 (fdt@ocelot_pcb123) Description: MSCC Ocelot PCB123 Device Tree Created: Mon Jul 29 22:53:35 2019 Type: Flat Device Tree Compression: uncompressed Data Size: 4615 Bytes = 4.51 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 8754eadee600cac22c9c34884cd901aac7e95e8a Image 4 (fdt@ocelot_pcb120) Description: MSCC Ocelot PCB120 Device Tree Created: Mon Jul 29 22:53:35 2019 Type: Flat Device Tree Compression: uncompressed Data Size: 5174 Bytes = 5.05 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 1ab7d0871c0a9345c6269fb491bf028224da8256 Image 5 (fdt@xilfpga) Description: MIPSfpga (xilfpga) Device Tree Created: Mon Jul 29 22:53:35 2019 Type: Flat Device Tree Compression: uncompressed Data Size: 2708 Bytes = 2.64 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 63d058b780f65e22da30f0a183433765f1807f1d Default Configuration: 'conf@default' Configuration 0 (conf@default) Description: Generic Linux kernel Kernel: kernel@0 Configuration 1 (conf@boston) Description: Boston Linux kernel Kernel: kernel@0 FDT: fdt@boston Configuration 2 (conf@ni169445) Description: NI 169445 Linux Kernel Kernel: kernel@0 FDT: fdt@ni169445 Configuration 3 (conf@ocelot_pcb123) Description: Ocelot Linux kernel Kernel: kernel@0 FDT: fdt@ocelot_pcb123 Configuration 4 (conf@ocelot_pcb120) Description: Ocelot Linux kernel Kernel: kernel@0 FDT: fdt@ocelot_pcb120 Configuration 5 (conf@xilfpga) Description: MIPSfpga Linux kernel Kernel: kernel@0 FDT: fdt@xilfpga Completed OK # rm -rf /kisskb/build/powerpc-fixes_mips-defconfig_mips # Build took: 0:00:55.831117