mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Wen <anmuxixixi@gmail.com>
To: linkinjeon@kernel.org, sj1557.seo@samsung.com, chizhiling@163.com
Cc: yuezhang.mo@sony.com, exfat@lists.linux.dev,
	linux-kernel@vger.kernel.org, Yang Wen <anmuxixixi@gmail.com>
Subject: [PATCH v3 0/3] exfat: speed up file creation in large directories
Date: Wed,  2 Sep 2026 23:24:52 +0800	[thread overview]
Message-ID: <20260902152455.1273557-1-anmuxixixi@gmail.com> (raw)

Negative name lookups and empty-entry allocation can repeatedly scan a
directory from the beginning. Bulk creation in a large directory therefore
approaches O(N^2).

This series separates the optimization into three independently reviewable
steps. Patch 1 adds the Bloom filter used to reject definite name misses.
Patch 2 retains and correctly invalidates the next-empty-entry hint. Patch 3
adds the LRU and shrinker used to reclaim filters under memory pressure.

Test environment:
  QEMU TCG multi-thread, 4 vCPUs, 6 GiB RAM
  4 GiB exFAT image, 32 KiB clusters

Creating 20,000 empty files improved from 589.48 seconds to 5.33 seconds,
which is a 110.6-fold speedup.

Changes in v3:
- Split the change into Bloom filter, empty-entry hint, and shrinker patches.
- Accept filenames containing exactly 255 UTF-16 code units while building
  the Bloom filter.
- Invalidate the empty-entry hint in every path that can free directory
  entries, preventing stale hints from skipping earlier holes.

Changes in v2:
- Move exfat_name_filter_free() to exfat_evict_inode() because
  ->free_inode() may run from an RCU callback in softirq context.

Yang Wen (3):
  exfat: add a Bloom filter for negative name lookups
  exfat: retain the next empty directory entry hint
  exfat: reclaim name filters under memory pressure

 fs/exfat/dir.c      | 279 ++++++++++++++++++++++++++++++++++++++++++++
 fs/exfat/exfat_fs.h |  23 ++++
 fs/exfat/inode.c    |   1 +
 fs/exfat/namei.c    |  58 ++++++++-
 fs/exfat/super.c    |   9 ++
 5 files changed, 369 insertions(+), 1 deletion(-)

-- 
2.34.1

             reply	other threads:[~2026-09-02 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 15:24 Yang Wen [this message]
2026-09-02 15:24 ` [PATCH v3 1/3] exfat: add a Bloom filter for negative name lookups Yang Wen
2026-10-19  0:27   ` NeilBrown
2026-09-02 15:24 ` [PATCH v3 2/3] exfat: retain the next empty directory entry hint Yang Wen
2026-09-11  0:02   ` Namjae Jeon
2026-09-02 15:24 ` [PATCH v3 3/3] exfat: reclaim name filters under memory pressure Yang Wen
2026-09-03  8:41 ` [PATCH v3 0/3] exfat: speed up file creation in large directories Chi Zhiling

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=20260902152455.1273557-1-anmuxixixi@gmail.com \
    --to=anmuxixixi@gmail.com \
    --cc=chizhiling@163.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®