POSIX_FADV_NOREUSE is now supported in Linux[1]. Updates text regarding former no op behavior. Indicates the readahead policy and treatment of file pages read with this flag. [1]: https://lore.kernel.org/linux-mm/20221230215252.2628425-2-yuzhao@xxxxxxxxxx/ Signed-off-by: T.J. Alumbaugh <talumbau@xxxxxxxxxx> Signed-off-by: Yuanchu Xie <yuanchu@xxxxxxxxxx> --- Changelog v3 -> v4 - Use semantic newlines - Format with macros like .B instead of inline \f v3: https://lore.kernel.org/linux-man/20230320222057.1976956-1-talumbau@xxxxxxxxxx/ man/man2/posix_fadvise.2 | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/man/man2/posix_fadvise.2 b/man/man2/posix_fadvise.2 index ed40b0c0d..11452699e 100644 --- a/man/man2/posix_fadvise.2 +++ b/man/man2/posix_fadvise.2 @@ -62,9 +62,15 @@ The specified data will be accessed in random order. .B POSIX_FADV_NOREUSE 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. +Before Linux 2.6.18, +.B POSIX_FADV_NOREUSE +had the same semantics as +.B POSIX_FADV_WILLNEED. +This was probably a bug; from Linux 2.6.18 until Linux 6.2 this flag was a no-op. +From Linux 6.3 and beyond, +.B POSIX_FADV_NOREUSE +signals that the LRU 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. @@ -127,9 +133,15 @@ Linux returned .B EINVAL in this case.) .SH VERSIONS -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. +Under Linux, +.B POSIX_FADV_NORMAL +sets the readahead window to the default size for the backing device; +.B POSIX_FADV_SEQUENTIAL +doubles this size, and +.B POSIX_FADV_RANDOM +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.46.0