[PATCH 2/2] mtd: ubi: use GFP_NOIO for lock tree entry allocation
Ye Linfei
yelinfei66 at gmail.com
Thu Oct 15 04:56:53 PDT 2026
On Thu, 2026-10-15 at 19:03 +0800, Zhihao Cheng wrote:
> The ltree_add_entry() has many callers that not need GFP_NOIO, I think
> 'mtd: ubi: block: forbid direct reclaim I/O during synchronous read'
> is enough.
Agreed, and thanks for catching this.
With memalloc_noio_save() in place, the ltree allocation inside
ubiblock_read() already drops __GFP_IO implicitly, so the explicit
GFP_NOIO there adds nothing. The remaining ltree_add_entry() callers
(ubi_eba_write_leb() and friends from cdev/update/wear-leveling paths)
run in process or kthread context rather than a blk-mq synchronous
dispatch loop, where swap I/O triggered by direct reclaim can complete
normally; forcing GFP_NOIO on them is unnecessary.
I will drop this patch and send a v2 with the block driver change only.
Ye Linfei
More information about the linux-mtd
mailing list