On 4/18/23 04:41, Pankaj Raghav wrote: >> +static bool g_nowait = true; >> +module_param_named(nowait, g_nowait, bool, 0444); >> +MODULE_PARM_DESC(virt_boundary, "Set QUEUE_FLAG_NOWAIT irrespective of queue mode. Default: True"); > Copy paste error. MODULE_PARM_DESC(nowait,... fixed.. >> + >> static bool g_virt_boundary = false; >> module_param_named(virt_boundary, g_virt_boundary, bool, 0444); >> MODULE_PARM_DESC(virt_boundary, "Require a virtual boundary for the device. Default: False"); >> @@ -983,11 +990,11 @@ static struct nullb_page *null_insert_page(struct nullb *nullb, >> >> spin_unlock_irq(&nullb->lock); >> >> - t_page = null_alloc_page(); >> + t_page = null_alloc_page(nullb->dev->nowait ? GFP_NOWAIT : GFP_NOIO); >> if (!t_page) >> goto out_lock; >> >> - if (radix_tree_preload(GFP_NOIO)) >> + if (radix_tree_preload(nullb->dev->nowait ? GFP_NOWAIT : GFP_NOIO)) > This is not correct. You need to use radix_tree_maybe_preload because > GFP_NOWAIT should not block and this WARN_ON_ONCE flag will trigger in > radix_tree_preload: > > /* Warn on non-sensical use... */ > WARN_ON_ONCE(!gfpflags_allow_blocking(gfp_mask)); > > I also verified this locally with your patch and while doing a simple fio > write with setting memory_backed=1. > > WARNING: CPU: 2 PID: 515 at lib/radix-tree.c:366 radix_tree_preload+0x12/0x20 > ... > RIP: 0010:radix_tree_preload+0x12/0x20 > <snip> > Call Trace: > <TASK> > null_insert_page+0x186/0x4e0 [null_blk] > null_transfer+0x588/0x990 [null_blk] > <snip> > thanks for pointing this out, will sendout V3 with above fix... -ck