From a0c510a1bcc61fe24b38b1c54a2e28a5ad65c048 Mon Sep 17 00:00:00 2001 From: Yuanchu Xie Date: Tue, 19 Nov 2024 20:52:14 -0800 Subject: [PATCH] posix_fadvise.2: POSIX_FADV_NOREUSE now supported. POSIX_FADV_NOREUSE is now supported in Linux. Update text regarding former no op behavior. Indicate the readahead policy and treatment of file pages read with this flag. Link: Signed-off-by: T.J. Alumbaugh Signed-off-by: Yuanchu Xie Message-Id: <20241120045214.1294799-1-yuanchu@google.com> Acked-by: Yu Zhao Signed-off-by: Alejandro Colomar --- man/man2/posix_fadvise.2 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/man/man2/posix_fadvise.2 b/man/man2/posix_fadvise.2 index 0be779ab4..c7a42baa9 100644 --- a/man/man2/posix_fadvise.2 +++ b/man/man2/posix_fadvise.2 @@ -64,7 +64,13 @@ The specified data will be accessed only once. .IP Before Linux 2.6.18, \fBPOSIX_FADV_NOREUSE\fP had the same semantics as \fBPOSIX_FADV_WILLNEED\fP. -This was probably a bug; since Linux 2.6.18, this flag is a no-op. +This was probably a bug; +from Linux 2.6.18 until Linux 6.2 this flag was a no-op. +Since Linux 6.3, +.B POSIX_FADV_NOREUSE +signals that the kernel page replacement algorithm +can ignore access to mapped page cache marked by this flag. +This is useful, for example, while streaming large files. .TP .B POSIX_FADV_WILLNEED The specified data will be accessed in the near future. @@ -130,6 +136,8 @@ in this case.) Under Linux, \fBPOSIX_FADV_NORMAL\fP sets the readahead window to the default size for the backing device; \fBPOSIX_FADV_SEQUENTIAL\fP doubles this size, and \fBPOSIX_FADV_RANDOM\fP disables file readahead entirely. +.B POSIX_FADV_NOREUSE +does not modify the readahead window size. These changes affect the entire file, not just the specified region (but other open file handles to the same file are unaffected). .SS C library/kernel differences -- 2.47.2