summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLi Chen <me@linux.beauty>2026-06-30 17:23:29 +0800
committerMichael S. Tsirkin <mst@redhat.com>2026-08-19 06:38:45 -0400
commit40f356e610df95728074b1fc2e2ccb54ca1b5659 (patch)
treecf40bf8619d7e74335e3236256c54a3dc6c7f65a /include
parent009e18ca5e35069127825d04fc6e5603d771f6c3 (diff)
downloadlinux-40f356e610df95728074b1fc2e2ccb54ca1b5659.tar.gz
linux-40f356e610df95728074b1fc2e2ccb54ca1b5659.zip
nvdimm: virtio_pmem: stop allocating child flush bio
pmem_submit_bio() passes the parent bio to nvdimm_flush() for REQ_FUA. For virtio-pmem this makes async_pmem_flush() allocate and submit a child PREFLUSH bio chained to the parent. That child allocation is in the block submit path. Making it blocking with GFP_NOIO can consume the same global bio mempool that submit_bio() uses, while making it GFP_ATOMIC can fail under pressure. A forced failure of the child allocation produced: virtio_pmem: forcing child bio allocation failure for test Buffer I/O error on dev pmem0, logical block 0, lost sync page write EXT4-fs (pmem0): I/O error while writing superblock EXT4-fs (pmem0): mount failed Avoid the child bio without turning REQ_FUA into a synchronous submit-path wait. Let provider flush callbacks return NVDIMM_FLUSH_ASYNC after taking ownership of parent bio completion. pmem_submit_bio() returns in that case, and virtio-pmem queues an ordered WQ_MEM_RECLAIM work item that runs the existing host flush path and completes the parent bio. This keeps the asynchronous completion model of the child-bio path while removing the child bio allocation from the submit path. Signed-off-by: Li Chen <me@linux.beauty> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20260630092338.2094628-5-me@linux.beauty>
Diffstat (limited to 'include')
-rw-r--r--include/linux/libnvdimm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index 28f086c4a187..d929d83abf3b 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -126,6 +126,15 @@ struct nd_mapping_desc {
struct bio;
struct resource;
struct nd_region;
+
+/*
+ * Provider flush callback return values:
+ * 0: flush completed synchronously
+ * <0: flush failed
+ * >0: flush completion was queued and @bio will be completed later
+ */
+#define NVDIMM_FLUSH_ASYNC 1
+
struct nd_region_desc {
struct resource *res;
struct nd_mapping_desc *mapping;