diff options
author | Hou Tao <houtao1@huawei.com> | 2024-08-31 12:37:50 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2024-10-25 18:05:49 +0300 |
commit | 86b74eb5a11e878151eb429c3810f1dcda090b8c (patch) | |
tree | 8266feaf1c4d599da5fb54b255a03b61c53c6c9f /scripts/gdb/linux/utils.py | |
parent | 41748675c0bf252b3c5f600a95830f0936d366c1 (diff) | |
download | linux-86b74eb5a11e878151eb429c3810f1dcda090b8c.tar.xz |
virtiofs: use GFP_NOFS when enqueuing request through kworker
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 the sg array may be greater than PAGE_SIZE, use
GFP_NOFS instead of GFP_ATOMIC to lower the possibility of memory
allocation failure and to avoid unnecessarily depleting the atomic
reserves. GFP_NOFS is not passed to virtio_fs_enqueue_req() directly,
GFP_KERNEL and memalloc_nofs_{save|restore} helpers are used instead.
It may seem OK to pass GFP_NOFS to virtio_fs_enqueue_req() as well when
queuing the request for the first time, but this is not the case. The
reason is that fuse_request_queue_background() may call
->queue_request_and_unlock() while holding fc->bg_lock, which is a
spin-lock. Therefore, still use GFP_ATOMIC for it.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions