Skip to content

exfat: improve performance of NO_FAT_CHAIN to FAT_CHAIN conversion

Chi Zhiling linux-fsdevel lkml 2 versions – Applied

Status from this message: Applied them to #dev.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 1 replyApplied
  2. v13 patches 2 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/6exfat: add block readahead in exfat_chain_cont_clusterfs/exfat/exfat_fs.h fs/exfat/fatent.c+46 -20 replies
2/6exfat: use readahead helper in exfat_allocate_bitmapfs/exfat/balloc.c+6 -120 replies
3/6exfat: use readahead helper in exfat_get_dentryfs/exfat/dir.c+14 -380 replies
4/6exfat: drop redundant sec parameter from exfat_mirror_bhfs/exfat/fatent.c+4 -70 replies
5/6exfat: optimize exfat_chain_cont_cluster with cached buffer headsfs/exfat/fatent.c+37 -120 replies
6/6exfat: fix error handling for FAT table operationsfs/exfat/exfat_fs.h fs/exfat/fatent.c fs/exfat/inode.c +2 more+16 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] exfat: improve performance of NO_FAT_CHAIN to FAT_CHAIN conversion

From: Chi Zhiling <[email protected]>

This series improves the performance when converting files from NO_FAT_CHAIN to FAT_CHAIN format (which happens when a file cannot allocate contiguous clusters). It also adds proper error handling for FAT table write operations.

- Patch 1: Add block readahead for FAT blocks during conversion
- Patch 2-3: Refactor existing readahead code to use the new helper
- Patch 4: Remove redundant sec parameter from exfat_mirror_bh
- Patch 5: Cache buffer heads to reduce mark_buffer_dirty overhead
- Patch 6: Fix error handling to propagate FAT write errors to callers

Performance improvements for converting a 30GB file:

| Cluster Size | Before | After  | Speedup |
|--------------|--------|--------|---------|
| 512 bytes    | 47.667s| 1.866s | 25.5x   |
| 4KB          | 6.436s | 0.236s | 27.3x   |
| 32KB         | 0.758s | 0.034s | 22.3x   |
| 256KB        | 0.117s | 0.006s | 19.5x   |

v1: https://lore.kernel.org/all/[email protected]/

Chi Zhiling (6):
exfat: add block readahead in exfat_chain_cont_cluster
exfat: use readahead helper in exfat_allocate_bitmap
exfat: use readahead helper in exfat_get_dentry
exfat: drop redundant sec parameter from exfat_mirror_bh
exfat: optimize exfat_chain_cont_cluster with cached buffer heads
exfat: fix error handling for FAT table operations

 fs/exfat/balloc.c   | 18 +++------
 fs/exfat/dir.c      | 52 +++++++------------------
 fs/exfat/exfat_fs.h | 13 +++++--
 fs/exfat/fatent.c   | 95 ++++++++++++++++++++++++++++++++++++---------
 fs/exfat/inode.c    |  5 ++-
 fs/exfat/misc.c     |  8 +++-
 fs/exfat/namei.c    |  3 +-
 7 files changed, 118 insertions(+), 76 deletions(-)
Signature · 1 line
2.43.0