From: Showta Ishizaki <zakinko@snowrabbit.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Showta Ishizaki <zakinko@snowrabbit.org>
Subject: [PATCH] ufs: add readahead
Date: Wed, 25 Nov 2026 23:54:14 +0900 [thread overview]
Message-ID: <20261126-ufs-07-v1@snowrabbit.org> (raw)
ufs has no ->readahead(), so readahead reads one folio at a time
through ->read_folio(). Use mpage_readahead(), as ext2 does.
Reading 128 MiB with dd from virtio-blk after dropping the caches, five
times, in MB/s: 635-667 before and 1063-1193 after with 1K fragments,
1135-1216 before and 1457-1506 after with 4K fragments.
Signed-off-by: Showta Ishizaki <zakinko@snowrabbit.org>
---
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index c9ff8673f..fc3d2ec77 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -457,6 +457,11 @@ static int ufs_read_folio(struct file *file, struct folio *folio)
return block_read_full_folio(folio, ufs_getfrag_block);
}
+static void ufs_readahead(struct readahead_control *rac)
+{
+ mpage_readahead(rac, ufs_getfrag_block);
+}
+
int ufs_prepare_chunk(struct folio *folio, loff_t pos, unsigned len)
{
return __block_write_begin(folio, pos, len, ufs_getfrag_block);
@@ -510,6 +515,7 @@ const struct address_space_operations ufs_aops = {
.dirty_folio = block_dirty_folio,
.invalidate_folio = block_invalidate_folio,
.read_folio = ufs_read_folio,
+ .readahead = ufs_readahead,
.writepages = ufs_writepages,
.write_begin = ufs_write_begin,
.write_end = ufs_write_end,
base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
reply other threads:[~2026-11-25 14:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261126-ufs-07-v1@snowrabbit.org \
--to=zakinko@snowrabbit.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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®