From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org
Cc: LKML <linux-kernel@vger.kernel.org>,
dhavale@google.com, Gao Xiang <hsiangkao@linux.alibaba.com>
Subject: [PATCH 5/5] erofs: enable sub-page compressed block support
Date: Wed, 6 Dec 2023 17:10:57 +0800 [thread overview]
Message-ID: <20231206091057.87027-6-hsiangkao@linux.alibaba.com> (raw)
In-Reply-To: <20231206091057.87027-1-hsiangkao@linux.alibaba.com>
Let's just disable cached decompression and inplace I/Os for partial
pages as a first step in order to enable sub-page block initial
support. In other words, currently it works primarily based on
temporary short-lived pages. Don't expect too much in terms of
performance.
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
fs/erofs/inode.c | 6 ++++--
fs/erofs/zdata.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index 14a79d3226ab..3d616dea55dc 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -259,8 +259,10 @@ static int erofs_fill_inode(struct inode *inode)
if (erofs_inode_is_data_compressed(vi->datalayout)) {
#ifdef CONFIG_EROFS_FS_ZIP
- if (!erofs_is_fscache_mode(inode->i_sb) &&
- inode->i_sb->s_blocksize_bits == PAGE_SHIFT) {
+ if (!erofs_is_fscache_mode(inode->i_sb)) {
+ DO_ONCE_LITE_IF(inode->i_sb->s_blocksize != PAGE_SIZE,
+ erofs_info, inode->i_sb,
+ "EXPERIMENTAL EROFS subpage compressed block support in use. Use at your own risk!");
inode->i_mapping->a_ops = &z_erofs_aops;
err = 0;
goto out_unlock;
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index d02989466711..a2c3e87d2f81 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -563,6 +563,8 @@ static void z_erofs_bind_cache(struct z_erofs_decompress_frontend *fe)
__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN;
unsigned int i;
+ if (i_blocksize(fe->inode) != PAGE_SIZE)
+ return;
if (fe->mode < Z_EROFS_PCLUSTER_FOLLOWED)
return;
@@ -967,12 +969,12 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
struct inode *const inode = fe->inode;
struct erofs_map_blocks *const map = &fe->map;
const loff_t offset = page_offset(page);
+ const unsigned int bs = i_blocksize(inode);
bool tight = true, exclusive;
unsigned int cur, end, len, split;
int err = 0;
z_erofs_onlinepage_init(page);
-
split = 0;
end = PAGE_SIZE;
repeat:
@@ -1021,7 +1023,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
* for inplace I/O or bvpage (should be processed in a strict order.)
*/
tight &= (fe->mode > Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE);
- exclusive = (!cur && ((split <= 1) || tight));
+ exclusive = (!cur && ((split <= 1) || (tight && bs == PAGE_SIZE)));
if (cur)
tight &= (fe->mode >= Z_EROFS_PCLUSTER_FOLLOWED);
--
2.39.3
next prev parent reply other threads:[~2023-12-06 9:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 9:10 [PATCH 0/5] erofs: basic sub-page compressed data support Gao Xiang
2023-12-06 9:10 ` [PATCH 1/5] erofs: support I/O submission for sub-page compressed blocks Gao Xiang
2023-12-11 8:10 ` Gao Xiang
2023-12-06 9:10 ` [PATCH 2/5] erofs: record `pclustersize` in bytes instead of pages Gao Xiang
2023-12-06 9:10 ` [PATCH 3/5] erofs: fix up compacted indexes for block size < 4096 Gao Xiang
2023-12-06 9:10 ` [PATCH 4/5] erofs: refine z_erofs_transform_plain() for sub-page block support Gao Xiang
2023-12-08 5:20 ` Yue Hu
2023-12-08 7:34 ` Gao Xiang
2023-12-08 7:44 ` Gao Xiang
2023-12-08 8:30 ` Yue Hu
2023-12-06 9:10 ` Gao Xiang [this message]
2023-12-11 6:50 ` [PATCH 0/5] erofs: basic sub-page compressed data support Yue Hu
2023-12-14 14:58 ` Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231206091057.87027-6-hsiangkao@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=dhavale@google.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®