]> www.infradead.org Git - users/jedix/linux-maple.git/commit
exfat: support batch discard of clusters when freeing clusters
authorYuezhang Mo <Yuezhang.Mo@sony.com>
Wed, 12 Feb 2025 06:18:12 +0000 (14:18 +0800)
committerNamjae Jeon <linkinjeon@kernel.org>
Thu, 27 Mar 2025 12:18:02 +0000 (21:18 +0900)
commita36e0ab44cb344728f7c0fdc34edcbae64739c16
tree475d7f98754d91aca78c2dee40676ebae4533bcd
parent1a9239bb4253f9076b5b4b2a1a4e8d7defd77a95
exfat: support batch discard of clusters when freeing clusters

If the discard mount option is enabled, the file's clusters are
discarded when the clusters are freed. Discarding clusters one by
one will significantly reduce performance. Poor performance may
cause soft lockup when lots of clusters are freed.

This commit improves performance by discarding contiguous clusters
in batches.

Measure the performance by:

  # truncate -s 80G /mnt/file
  # time rm /mnt/file

Without this commit:

  real    4m46.183s
  user    0m0.000s
  sys     0m12.863s

With this commit:

  real    0m1.661s
  user    0m0.000s
  sys     0m0.017s

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/exfat/balloc.c
fs/exfat/fatent.c