Re: [PATCH RFC v3 1/1] mtd_blkdevs: avoid soft lockups with some mtd/spi devices

From: Richard Weinberger
Date: Wed Jan 26 2022 - 05:16:49 EST


----- Ursprüngliche Mail -----
> Von: "David Decotigny" <decot+git@xxxxxxxxxx>
> An: "linux-kernel" <linux-kernel@xxxxxxxxxxxxxxx>
> CC: "Miquel Raynal" <miquel.raynal@xxxxxxxxxxx>, "richard" <richard@xxxxxx>, "Vignesh Raghavendra" <vigneshr@xxxxxx>,
> "linux-mtd" <linux-mtd@xxxxxxxxxxxxxxxxxxx>, "David Decotigny" <ddecotig@xxxxxxxxxx>
> Gesendet: Mittwoch, 26. Januar 2022 11:11:20
> Betreff: [PATCH RFC v3 1/1] mtd_blkdevs: avoid soft lockups with some mtd/spi devices

> From: David Decotigny <ddecotig@xxxxxxxxxx>
>
> With some spi devices, the heavy cpu usage due to polling the spi
> registers may lead to netdev timeouts, RCU complaints, etc. This can
> be acute in the absence of CONFIG_PREEMPT. This patch allows to give
> enough breathing room to avoid those incorrectly detected netdev
> timeouts for example.
>
> Example splat on 5.10.92:
> [ 828.399306] rcu: INFO: rcu_sched self-detected stall on CPU
> ...
> [ 828.419245] Task dump for CPU 1:
> [ 828.422465] task:kworker/1:1H state:R running task on cpu 1 stack:
> 0 pid: 76 ppid: 2 flags:0x0000002a
> [ 828.433132] Workqueue: kblockd blk_mq_run_work_fn
> [ 828.437820] Call trace:
> ...
> [ 828.512267] spi_mem_exec_op+0x4d0/0xde0
> [ 828.516184] spi_mem_dirmap_read+0x180/0x39c
> [ 828.520443] spi_nor_read_data+0x428/0x7e8
> [ 828.524523] spi_nor_read+0x154/0x214
> [ 828.528172] mtd_read_oob+0x440/0x714
> [ 828.531815] mtd_read+0xac/0x120
> [ 828.535030] mtdblock_readsect+0x178/0x230
> [ 828.539102] mtd_blktrans_work+0x9fc/0xf28
> [ 828.543177] mtd_queue_rq+0x1ac/0x2e4
> [ 828.546827] blk_mq_dispatch_rq_list+0x2cc/0xa44
> [ 828.551419] blk_mq_do_dispatch_sched+0xb0/0x7cc
> [ 828.556010] __blk_mq_sched_dispatch_requests+0x350/0x494
> [ 828.561372] blk_mq_sched_dispatch_requests+0xac/0xe4
> [ 828.566387] __blk_mq_run_hw_queue+0x130/0x254
> [ 828.570806] blk_mq_run_work_fn+0x50/0x60
> [ 828.574814] process_one_work+0x578/0xf1c
> [ 828.578814] worker_thread+0x5dc/0xea0
> [ 828.582547] kthread+0x270/0x2d4
> [ 828.585765] ret_from_fork+0x10/0x30
>
>
> Signed-off-by: David Decotigny <ddecotig@xxxxxxxxxx>

Reviewed-by: Richard Weinberger <richard@xxxxxx>

Thanks,
//richard