From: Chi Zhiling <chizhiling@163.com>
To: Yang Wen <anmuxixixi@gmail.com>,
linkinjeon@kernel.org, sj1557.seo@samsung.com,
yuezhang.mo@sony.com
Cc: exfat@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] exfat: speed up file creation in large directories
Date: Tue, 1 Sep 2026 15:45:24 +0800 [thread overview]
Message-ID: <d112a566-eaf0-4db5-ad33-91208b98e82d@163.com> (raw)
In-Reply-To: <20260831151539.1239134-1-anmuxixixi@gmail.com>
On 8/31/26 11:15 PM, Yang Wen wrote:
> Negative name lookups scan a directory from the beginning. Repeating
> this scan before creating each file makes bulk file creation approach
> O(N^2).
>
> Add a 64 KiB per-directory Bloom filter and retain the next empty entry
> found during directory scans. A definite Bloom filter miss skips the
> directory scan, while a possible match falls back to the normal lookup
> path, preserving correctness in the presence of hash collisions.
>
> To avoid overhead for small directories, build the filter lazily when a
> directory reaches 1024 on-disk directory entries. A filter reclaimed
> under memory pressure is rebuilt on demand.
>
> Manage the filters using a per-superblock LRU and shrinker so that filters
> for inactive directories can be reclaimed under memory pressure.
>
> Test environment:
> QEMU TCG multi-thread, 4 vCPUs, 6 GiB RAM
> 4 GiB exFAT image, 32 KiB clusters
>
> Test script:
> mount -t exfat /dev/vda /mnt/test
> time sh -c '
> i=0
> while [ "$i" -lt 20000 ]; do
> : > "/mnt/test/f.$i" || exit 1
> i=$((i + 1))
> done
> '
>
> The measured results were:
>
> Before After
> real 589.48 s 5.33 s
> user 4.72 s 2.28 s
> sys 584.63 s 3.03 s
>
> The elapsed time was reduced by 99.10%, from 589.48 seconds to
> 5.33 seconds, corresponding to a 110.6-fold speedup.
>
> Signed-off-by: Yang Wen <anmuxixixi@gmail.com>
> ---
>
> Changes in v2:
> - Move exfat_name_filter_free() from exfat_free_inode() to
> exfat_evict_inode(), after truncate_inode_pages_final(), because
> ->free_inode() may run from an RCU callback in softirq context.
> - Link to v1: https://lore.kernel.org/all/20260828145838.1187356-1-anmuxixixi@gmail.com/
> ---
> fs/exfat/dir.c | 280 ++++++++++++++++++++++++++++++++++++++++++++
> fs/exfat/exfat_fs.h | 22 ++++
> fs/exfat/inode.c | 1 +
> fs/exfat/namei.c | 44 ++++++-
> fs/exfat/super.c | 9 ++
> 5 files changed, 355 insertions(+), 1 deletion(-)
This is a fairly large patch, which makes the review a bit more
challenging. Perhaps next time you could consider splitting it into
multiple patches in a patch series :)
Reviewed-by: Chi Zhiling <chizhiling@kylinos.cn>
next prev parent reply other threads:[~2026-09-01 7:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 15:15 Yang Wen
2026-09-01 7:45 ` Chi Zhiling [this message]
2026-09-02 15:34 ` Yang Wen
2026-09-02 0:40 ` Namjae Jeon
2026-09-02 15:31 ` Yang Wen
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=d112a566-eaf0-4db5-ad33-91208b98e82d@163.com \
--to=chizhiling@163.com \
--cc=anmuxixixi@gmail.com \
--cc=exfat@lists.linux.dev \
--cc=linkinjeon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sj1557.seo@samsung.com \
--cc=yuezhang.mo@sony.com \
/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®