Re: [PATCH v2] virtiofs: use GFP_NOFS when enqueuing request through kworker

From: Benjamin Coddington
Date: Mon Jan 08 2024 - 10:48:45 EST


On 5 Jan 2024, at 5:53, Hou Tao wrote:

> From: Hou Tao <houtao1@xxxxxxxxxx>
>
> When invoking virtio_fs_enqueue_req() through kworker, both the
> allocation of the sg array and the bounce buffer still use GFP_ATOMIC.
> Considering the size of both the sg array and the bounce buffer may be
> greater than PAGE_SIZE, use GFP_NOFS instead of GFP_ATOMIC to lower the
> possibility of memory allocation failure.

Perhaps not appropriate for this case, but are you aware of
memalloc_nofs_save/restore? NFS has been converting over and cleaning out
our GFP_NOFS usage:

Documentation/core-api/gfp_mask-from-fs-io.rst

Ben