Re: [PATCH RFC] fs/ntfs3: disable readahead for compressed files

From: Matthew Wilcox
Date: Sat Nov 01 2025 - 12:03:28 EST


On Tue, Oct 28, 2025 at 05:51:31PM +0100, Konstantin Komarov wrote:
> Reading large compressed files is extremely slow when readahead is enabled.
> For example, reading a 4 GB XPRESS-4K compressed file (compression ratio
> ≈ 4:1) takes about 230 minutes with readahead enabled, but only around 3
> minutes when readahead is disabled.
>
> The issue was first observed in January 2025 and is reproducible with large
> compressed NTFS files. Disabling readahead for compressed files avoids this
> performance regression, although this may not be the ideal long-term fix.
>
> This patch is submitted as an RFC to gather feedback on whether disabling
> readahead is an acceptable solution or if a more targeted fix should be
> implemented.

I suspect your real problem is that readahead is synchronous in ntfs3
and the VFS is not expecting this. Your get_block (ntfs_get_block_vbo)
calls bh_read() which waits for the I/O to complete. That means we get
no pipelining which will significantly reduce bandwidth.