Skip to contentSkip to conversation

posix_fadvise.2: POSIX_FADV_NOREUSE now supported.

PATCH Superseded Yuanchu Xie 2 participants 2 messages Nov 14, 2024 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 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.

---
Changelog
v4 -> v5
- Remove unnecessary changes
- Use two space inter-sentence spacing
- Fix lines exceeding 80-column

v3 -> v4
- Use semantic newlines
- Format with macros like .B instead of inline \f

v3: https://lore.kernel.org/linux-man/[email protected]/
v4: https://lore.kernel.org/linux-man/[email protected]/

 man/man2/posix_fadvise.2 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
man/man2/posix_fadvise.2 +9 -1
index ed40b0c0d..3c47efeb8 100644
@@ -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.
+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.
@@ -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
Signature · 1 line
2.46.0
#1 lore raw

Hi Yuanchu,

Quoted 29 lines · Yuanchu Xie

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.

---
Changelog
v4 -> v5
- Remove unnecessary changes
- Use two space inter-sentence spacing
- Fix lines exceeding 80-column

v3 -> v4
- Use semantic newlines
- Format with macros like .B instead of inline \f

v3: https://lore.kernel.org/linux-man/[email protected]/
v4: https://lore.kernel.org/linux-man/[email protected]/

 man/man2/posix_fadvise.2 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
man/man2/posix_fadvise.2 +0 -0
index ed40b0c0d..3c47efeb8 100644

man/man2/posix_fadvise.2 The specified data will be accessed only once. · line 69

Quoted 7 lines
man/man2/posix_fadvise.2 +3 -1
@@ -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.
+From Linux 6.3 and beyond,

'Since' means precisely "from ... and beyond", so I'd rewrite this as

Since Linux 6.3,

man/man2/posix_fadvise.2 The specified data will be accessed only once. · line 71

Quoted 2 lines
man/man2/posix_fadvise.2 +2 -0
+.B POSIX_FADV_NOREUSE
+signals that the LRU algorithm

What is the LRU algorithm? I suggest saying

signals that the Last Recently Used (LRU) algorithm

Have alovely day!
Alex

Quoted 17 lines
man/man2/posix_fadvise.2 +4 -0
+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
Signature · 1 line
2.46.0
Signature · 1 line
<https://www.alejandro-colomar.es/>