mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 00/13] ntfs: add large folio support for ordinary files
@ 2026-12-03  4:03 Baolin Liu
  2026-12-03  4:03 ` [PATCH v1 01/13] ntfs: limit writeback allocation to the dirty range Baolin Liu
                   ` (13 more replies)
  0 siblings, 14 replies; 17+ messages in thread
From: Baolin Liu @ 2026-12-03  4:03 UTC (permalink / raw)
  To: linkinjeon, hyc.lee; +Cc: ntfs, linux-kernel, Baolin Liu

From: Baolin Liu <liubaolin@kylinos.cn>

This series enables large page-cache folios for ordinary, unnamed NTFS
regular-file data streams through iomap. It applies to ntfs-next at
f674e4b6c315 ("ntfs: serialize export parent reconstruction"), fetched on
26 November 2026, with no additional prerequisite patches.

Large folios require CONFIG_TRANSPARENT_HUGEPAGE; order-0 fallback remains
available. The policy excludes metadata, SYSTEM-marked files, directories,
named/internal streams, MST-protected data, encrypted files and files
already using native or WOF compression when initialized. It covers new
files, O_TMPFILE files and resident files that grow nonresident.

Empty files can change native compression while retaining their original
folio policy. Prepare compressed reads and writes for this case, including
folios spanning compression units. Retained VMAs can still read; writes
through retained shared writable VMAs fault with SIGBUS. New mmap requests
for compressed files remain unsupported.

Patches 1-8 fix writeback, cache-coherency, locking and space-accounting
issues found during validation without large folios. Patch 8 keeps 2% of
the volume, capped at 4096 clusters, for MFT, MFT bitmap and attribute-list
growth. This reduces f_bavail and data capacity, including for root, and
is separate from MFT zone placement. Patches 9-12 handle compression
switching, folio I/O and EOF within a base page. Patch 13 enables large
folios and documents the scope.

Performance measurements compare an order-0 kernel based on 8a27d1f43f1b
with a large-folio-enabled build of the same base. The setup was x86-64
KVM (2 vCPUs, 3 GiB RAM), NVMe-backed raw images on host ext4, 512-byte
NTFS clusters and 1 GiB files. fio 3.41 used one buffered psync worker,
1 MiB sequential I/O and 4 KiB random reads. Tracing was disabled during
timing.

The mixed workload used four VM boots in control/folio/folio/control
order, with five rounds per boot. Values are medians within each boot,
then medians across boots:

  Metric                            Order-0   Large folios    Change
  Warm sequential read (MiB/s)         16012          18616    +16.3%
  Warm random read (MiB/s)              5098           6265    +22.9%
  Write + fsync (MiB/s)                 2449           2691     +9.9%
  mmap page-touch, 50 passes (s)       1.689          1.460    -13.6%
  Cold sequential read (MiB/s)          3489           3382     -3.1%
  Cold-read task CPU (s/GiB)         0.1295         0.0655    -49.4%
  Write task CPU (s/GiB)             0.1550         0.0655    -57.7%

CPU figures are fio task user+system time per GiB, excluding host QEMU
CPU. A follow-up cold-read-only comparison reused the same read-only
image across eight boots (ABBA + BAAB, five rounds per boot). Throughput
was 3568 versus 3619 MiB/s (+1.4%, broadly unchanged), while task CPU
fell from 0.1260 to 0.0655 s/GiB (-48.0%). All boots, including one slow
control boot, are included. These measurements show lower task CPU cost
and gains in cached reads and writes under this VM-backed storage setup;
they do not establish a general cold-read throughput improvement.

Offline consistency checks used ntfsck from ntfsprogs-plus. The x86
guests invoked it as fsck.ntfs -n after unmounting the test volumes.

Functional and regression tests used the same source trees as this
series and its control:

  - W=1 fs/ntfs builds at every patch boundary with debug and minimal
    configurations; full x86-64 and ARM64 64 KiB-page kernel builds.
  - x86-64 KVM: 111 data comparisons and ten offline consistency checks
    passed.
  - ARM64 TCG with 64 KiB base pages: 136 checks, ten compressed EOF
    cases and three offline consistency checks passed; observed folio
    orders 1-6.
  - Six complete x86-64 KVM xfstests auto runs with identical kernel
    configurations and xfstests v2025.11.04-10-gdf376ed02:

    Cluster   Control pass/fail/notrun   Series pass/fail/notrun
    512 B     306 / 45 / 212             308 / 43 / 212
    4 KiB     309 / 45 / 209             309 / 45 / 209
    64 KiB    307 / 45 / 211             307 / 45 / 211

The control includes patches 1-8, so the auto comparison isolates patches
9-13. All 563 selected tests completed per run, retaining the appliance's
210 default exclusions and adding none. There were no new failures or
notruns, and notrun reasons matched.

Existing failures include consistency errors reported by ntfsck on the
scratch filesystem. ARM64 testing did not cover 512 MiB PMD collapse and
still reported the existing MFT extent-record diagnostic on 512-byte
clusters. Some x86 guests reported root ext4/vda I/O errors after
power-down.

Baolin Liu (13):
  ntfs: limit writeback allocation to the dirty range
  ntfs: read compression units without the block device page cache
  ntfs: snapshot resident data for direct reads
  ntfs: allow vmalloc for large runlist backups
  ntfs: preserve delalloc reservations when allocating holes
  ntfs: serialize delalloc reservations with cluster allocation
  ntfs: respect space reservations when writing compressed data
  ntfs: keep space for MFT growth during delayed allocation
  ntfs: serialize compression changes with file access
  ntfs: complete compressed reads at folio granularity
  ntfs: stop compressed reads at EOF within a base page
  ntfs: preserve large folios during compressed writes
  ntfs: enable large folios for ordinary files

 Documentation/filesystems/ntfs.rst |  34 ++++
 fs/ntfs/attrib.c                   |  15 +-
 fs/ntfs/attrlist.c                 |   2 +-
 fs/ntfs/compress.c                 | 317 +++++++++++++++--------------
 fs/ntfs/ea.c                       |   7 +
 fs/ntfs/file.c                     |  26 ++-
 fs/ntfs/inode.c                    |  10 +
 fs/ntfs/iomap.c                    |  43 +++-
 fs/ntfs/lcnalloc.c                 |  18 +-
 fs/ntfs/lcnalloc.h                 |  13 +-
 fs/ntfs/mft.c                      |   7 +-
 fs/ntfs/ntfs_codec.h               |   2 +-
 fs/ntfs/super.c                    |  18 +-
 fs/ntfs/volume.h                   |   2 +
 14 files changed, 317 insertions(+), 197 deletions(-)


base-commit: f674e4b6c315ebe742d08af80659386992d58ce9


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-12-03 10:10 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-03  4:03 [PATCH v1 00/13] ntfs: add large folio support for ordinary files Baolin Liu
2026-12-03  4:03 ` [PATCH v1 01/13] ntfs: limit writeback allocation to the dirty range Baolin Liu
2026-12-03  4:03 ` [PATCH v1 02/13] ntfs: read compression units without the block device page cache Baolin Liu
2026-12-03  4:03 ` [PATCH v1 03/13] ntfs: snapshot resident data for direct reads Baolin Liu
2026-12-03  4:03 ` [PATCH v1 04/13] ntfs: allow vmalloc for large runlist backups Baolin Liu
2026-12-03  4:03 ` [PATCH v1 05/13] ntfs: preserve delalloc reservations when allocating holes Baolin Liu
2026-12-03  4:03 ` [PATCH v1 06/13] ntfs: serialize delalloc reservations with cluster allocation Baolin Liu
2026-12-03  4:03 ` [PATCH v1 07/13] ntfs: respect space reservations when writing compressed data Baolin Liu
2026-12-03  4:03 ` [PATCH v1 08/13] ntfs: keep space for MFT growth during delayed allocation Baolin Liu
2026-12-03  4:03 ` [PATCH v1 09/13] ntfs: serialize compression changes with file access Baolin Liu
2026-12-03  4:03 ` [PATCH v1 10/13] ntfs: complete compressed reads at folio granularity Baolin Liu
2026-12-03  4:03 ` [PATCH v1 11/13] ntfs: stop compressed reads at EOF within a base page Baolin Liu
2026-12-03  4:03 ` [PATCH v1 12/13] ntfs: preserve large folios during compressed writes Baolin Liu
2026-12-03  4:03 ` [PATCH v1 13/13] ntfs: enable large folios for ordinary files Baolin Liu
2026-12-03  4:23 ` [PATCH v1 00/13] ntfs: add large folio support " liubaolin
2026-12-03  5:30   ` Namjae Jeon
2026-12-03 10:10     ` liubaolin

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®