Re: [PATCH] Revert "cpumask: fix checking valid cpu range"

From: Guo Ren
Date: Mon Oct 17 2022 - 21:56:23 EST


On Tue, Oct 18, 2022 at 3:53 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Mon, 17 Oct 2022 10:56:05 +0800 Guo Ren wrote:
> > Ping Jakub Kicinski <kuba@xxxxxxxxxx>.
> >
> > You seem to miss this Revert fixup on cpumask_check(n + 1).
> >
> > Your patch has merged in v6.1-rc1, but that is not enough.
> > https://lore.kernel.org/netdev/166582921612.1299.769135677399153914.git-patchwork-notify@xxxxxxxxxx/T/#m0111a76380626b2f91e072ecdd5827578d5cbf60
> >
> > Without the patch, there still is a warning.
>
> Sorry, I don't know what you mean. I was only putting a workaround back
> into the core networking code - I'm guessing this patch will silence
> the warning that comes from virtio? I haven't looked into that one.

Without the patch, Linux-v6.1-rc1 would warn when
CONFIG_DEBUG_PER_CPU_MAPS was enabled.

[ 2.130438] virtio_blk virtio0: 1/0/0 default/read/poll queues
[ 2.137585] virtio_blk virtio0: [vda] 122880 512-byte logical
blocks (62.9 MB/60.0 MiB)
[ 2.196181] lkdtm: No crash points registered, enable through debugfs
[ 2.246658] ------------[ cut here ]------------
[ 2.247468] WARNING: CPU: 3 PID: 1 at include/linux/cpumask.h:110
__netif_set_xps_queue+0x14e/0x792
[ 2.248738] Modules linked in:
[ 2.249323] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc1 #336
[ 2.250038] Hardware name: riscv-virtio,qemu (DT)
[ 2.250697] epc : __netif_set_xps_queue+0x14e/0x792
[ 2.251538] ra : __netif_set_xps_queue+0x56c/0x792
[ 2.252029] epc : ffffffff806f2972 ra : ffffffff806f2d90 sp :
ff600000023279d0
[ 2.252664] gp : ffffffff81603d88 tp : ff600000023a0000 t0 :
ff60000003068a40
[ 2.253270] t1 : 0000000000000003 t2 : 0000000000000000 s0 :
ff60000002327a90
[ 2.253878] s1 : 0000000000000000 a0 : ff60000003068a00 a1 :
ff60000003068a00
[ 2.254491] a2 : ff600000030687e8 a3 : 0000000000000004 a4 :
0000000000000000
[ 2.255521] a5 : 0000000000000000 a6 : 0000000000000000 a7 :
0000000000000000
[ 2.256506] s2 : 0000000000000000 s3 : 0000000000000000 s4 :
ff60000002327aa0
[ 2.257161] s5 : ffffffff816071c0 s6 : 0000000000000000 s7 :
0000000000000001
[ 2.257761] s8 : 0000000000000000 s9 : 0000000000000004 s10:
ff600000030687c0
[ 2.258369] s11: 0000000000000004 t3 : 0000000000000000 t4 :
0000000000000014
[ 2.259368] t5 : 0000000000000000 t6 : 0000000000000000
[ 2.260270] status: 0000000200000120 badaddr: 0000000000000000
cause: 0000000000000003
[ 2.261200] [<ffffffff805d941e>] virtnet_set_affinity+0x14a/0x1c0
[ 2.261837] [<ffffffff805db734>] virtnet_probe+0x832/0xf1e
[ 2.262319] [<ffffffff804ff5d0>] virtio_dev_probe+0x164/0x2de
[ 2.263055] [<ffffffff8054d478>] really_probe+0x82/0x224
[ 2.263858] [<ffffffff8054d674>] __driver_probe_device+0x5a/0xaa
[ 2.264445] [<ffffffff8054d6f0>] driver_probe_device+0x2c/0xb8
[ 2.264987] [<ffffffff8054dd1a>] __driver_attach+0x76/0x108
[ 2.265495] [<ffffffff8054b436>] bus_for_each_dev+0x52/0x9a
[ 2.265996] [<ffffffff8054ce40>] driver_attach+0x1a/0x28
[ 2.266475] [<ffffffff8054c94a>] bus_add_driver+0x154/0x1c2
[ 2.267383] [<ffffffff8054e546>] driver_register+0x52/0x108
[ 2.268198] [<ffffffff804ff0d4>] register_virtio_driver+0x1c/0x2c
[ 2.268778] [<ffffffff80a291a0>] virtio_net_driver_init+0x7a/0xb0
[ 2.269323] [<ffffffff80002854>] do_one_initcall+0x66/0x2e4
[ 2.269834] [<ffffffff80a01226>] kernel_init_freeable+0x28a/0x304
[ 2.270372] [<ffffffff808cc8b6>] kernel_init+0x1e/0x110
[ 2.271099] [<ffffffff80003d42>] ret_from_exception+0x0/0x10
[ 2.272015] ---[ end trace 0000000000000000 ]---

--
Best Regards
Guo Ren