[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241022111059.2566137-26-yi.zhang@huaweicloud.com>
Date: Tue, 22 Oct 2024 19:10:56 +0800
From: Zhang Yi <yi.zhang@...weicloud.com>
To: linux-ext4@...r.kernel.org
Cc: linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
tytso@....edu,
adilger.kernel@...ger.ca,
jack@...e.cz,
ritesh.list@...il.com,
hch@...radead.org,
djwong@...nel.org,
david@...morbit.com,
zokeefe@...gle.com,
yi.zhang@...wei.com,
yi.zhang@...weicloud.com,
chengzhihao1@...wei.com,
yukuai3@...wei.com,
yangerkun@...wei.com
Subject: [PATCH 25/27] ext4: enable large folio for regular file with iomap buffered I/O path
From: Zhang Yi <yi.zhang@...wei.com>
Since we have converted the buffered I/O path to iomap for regular
files, we can enable large folio support as well. This should result in
significant performance gains for large I/O operations.
Signed-off-by: Zhang Yi <yi.zhang@...wei.com>
---
fs/ext4/ialloc.c | 4 +++-
fs/ext4/inode.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 2e3e257b9808..6ff03fb74867 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -1333,8 +1333,10 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap,
}
}
- if (ext4_should_use_buffered_iomap(inode))
+ if (ext4_should_use_buffered_iomap(inode)) {
ext4_set_inode_state(inode, EXT4_STATE_BUFFERED_IOMAP);
+ mapping_set_large_folios(inode->i_mapping);
+ }
ext4_update_inode_fsync_trans(handle, inode, 1);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 512094dc4117..97abc88e6658 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -5437,8 +5437,10 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
if (ret)
goto bad_inode;
- if (ext4_should_use_buffered_iomap(inode))
+ if (ext4_should_use_buffered_iomap(inode)) {
ext4_set_inode_state(inode, EXT4_STATE_BUFFERED_IOMAP);
+ mapping_set_large_folios(inode->i_mapping);
+ }
if (S_ISREG(inode->i_mode)) {
inode->i_op = &ext4_file_inode_operations;
--
2.46.1
Powered by blists - more mailing lists