* [PATCH] ufs: add readahead
@ 2026-11-25 14:54 Showta Ishizaki
0 siblings, 0 replies; only message in thread
From: Showta Ishizaki @ 2026-11-25 14:54 UTC (permalink / raw)
To: Alexander Viro, Christian Brauner
Cc: Jan Kara, linux-fsdevel, linux-kernel, Showta Ishizaki
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 14:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 14:54 [PATCH] ufs: add readahead Showta Ishizaki
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®