[PATCH] erofs: allocate extra bvec pages from reserved buffer pool first by default

Chunhai Guo guochunhai at vivo.com
Tue Aug 13 20:27:23 AEST 2024


As the extra bvec pages are allocated and freed in a short time, it can
reduce the page allocation time by first allocating pages from the
reserved buffer pool [1].

[1] The reserved buffer pool and its benefits are detailed in
commit 0f6273ab4637 ("erofs: add a reserved buffer pool for lz4
decompression").

Signed-off-by: Chunhai Guo <guochunhai at vivo.com>
---
 fs/erofs/zdata.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index b979529be5ed..428ab617e0e4 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -232,7 +232,8 @@ static int z_erofs_bvec_enqueue(struct z_erofs_bvec_iter *iter,
 		struct page *nextpage = *candidate_bvpage;
 
 		if (!nextpage) {
-			nextpage = erofs_allocpage(pagepool, GFP_KERNEL);
+			nextpage = __erofs_allocpage(pagepool, GFP_KERNEL,
+					true);
 			if (!nextpage)
 				return -ENOMEM;
 			set_page_private(nextpage, Z_EROFS_SHORTLIVED_PAGE);
-- 
2.25.1



More information about the Linux-erofs mailing list