summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/compress.c
diff options
context:
space:
mode:
authorFengnan Chang <fengnanchang@gmail.com>2022-07-31 05:33:46 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2022-08-05 13:20:55 +0200
commit01fc4b9a6ed8eacb64e5609bab7ac963e1c7e486 (patch)
treefd9b29eea4542fca39e99bf244a1af141cee154f /fs/f2fs/compress.c
parentf2fs: intorduce f2fs_all_cluster_page_ready (diff)
downloadlinux-01fc4b9a6ed8eacb64e5609bab7ac963e1c7e486.tar.xz
linux-01fc4b9a6ed8eacb64e5609bab7ac963e1c7e486.zip
f2fs: use onstack pages instead of pvec
Since pvec have 15 pages, it not a multiple of 4, when write compressed pages, write in 64K as a unit, it will call pagevec_lookup_range_tag agagin, sometimes this will take a lot of time. Use onstack pages instead of pvec to mitigate this problem. Signed-off-by: Fengnan Chang <fengnanchang@gmail.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/compress.c')
-rw-r--r--fs/f2fs/compress.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index 75886b493ec3..87bf06e15efe 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -841,10 +841,10 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index)
return is_page_in_cluster(cc, index);
}
-bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct pagevec *pvec,
+bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct page **pages,
int index, int nr_pages, bool uptodate)
{
- unsigned long pgidx = pvec->pages[index]->index;
+ unsigned long pgidx = pages[index]->index;
int i = uptodate ? 0 : 1;
/*
@@ -858,9 +858,9 @@ bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct pagevec *pvec,
return false;
for (; i < cc->cluster_size; i++) {
- if (pvec->pages[index + i]->index != pgidx + i)
+ if (pages[index + i]->index != pgidx + i)
return false;
- if (uptodate && !PageUptodate(pvec->pages[index + i]))
+ if (uptodate && !PageUptodate(pages[index + i]))
return false;
}