* + fat-improve-fat_sync_bhs-write-submission.patch added to mm-nonmm-unstable branch
@ 2026-10-27 3:41 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-27 3:41 UTC (permalink / raw)
To: mm-commits, hirofumi, matheus.aalmeida, akpm
The patch titled
Subject: fat: improve fat_sync_bhs() write submission
has been added to the -mm mm-nonmm-unstable branch. Its filename is
fat-improve-fat_sync_bhs-write-submission.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/fat-improve-fat_sync_bhs-write-submission.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Matheus Alves de Almeida <matheus.aalmeida@inf.ufrgs.br>
Subject: fat: improve fat_sync_bhs() write submission
Date: Mon, 26 Oct 2026 13:39:41 -0300
fat_sync_bhs() does many individual write_dirty_buffer() calls without
plugging, making batching in the block layer more difficult. It also does
not pass the REQ_SYNC hint for these synchronous writes.
Use a plug around the writes so the block layer can more easily batch
them. Pass the REQ_SYNC hint to write_dirty_buffer().
Benchmarking was done under QEMU/KVM with a virtio-blk device using
cache=directsync. Each result is the arithmetic mean of 10 samples.
start = now_ns();
for (unsigned i = 0; i < count; i++) {
fallocate(fds[i], FALLOC_FL_KEEP_SIZE, 0, bytes);
}
elapsed = now_ns() - start;
Sync-mounted FAT32 using count=16 files:
File size Cluster size Before After Improvement
256MiB 512B 13.11s 11.87s 1.10x
256MiB 4096B 1.657s 1.469s 1.13x
Link: https://lore.kernel.org/20261026163941.495833-3-matheus.aalmeida@inf.ufrgs.br
Signed-off-by: Matheus Alves de Almeida <matheus.aalmeida@inf.ufrgs.br>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---
fs/fat/misc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/fs/fat/misc.c~fat-improve-fat_sync_bhs-write-submission
+++ a/fs/fat/misc.c
@@ -9,6 +9,7 @@
#include "fat.h"
#include <linux/iversion.h>
+#include <linux/blk_plug.h>
/*
* fat_fs_error reports a file system problem that might indicate fa data
@@ -353,9 +354,14 @@ EXPORT_SYMBOL_GPL(fat_update_time);
int fat_sync_bhs(struct buffer_head **bhs, int nr_bhs)
{
int i, err = 0;
+ struct blk_plug plug;
+
+ blk_start_plug(&plug);
for (i = 0; i < nr_bhs; i++)
- write_dirty_buffer(bhs[i], 0);
+ write_dirty_buffer(bhs[i], REQ_SYNC);
+
+ blk_finish_plug(&plug);
for (i = 0; i < nr_bhs; i++) {
wait_on_buffer(bhs[i]);
_
Patches currently in -mm which might be from matheus.aalmeida@inf.ufrgs.br are
fat-preallocate-space-before-expanding-in-fat_cont_expand.patch
fat-hold-truncate_lock-in-fat_write_failed.patch
fat-batch-synchronous-mirror-writes.patch
fat-improve-fat_sync_bhs-write-submission.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-27 3:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-27 3:41 + fat-improve-fat_sync_bhs-write-submission.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.