public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5] posix_fadvise.2: POSIX_FADV_NOREUSE now supported.
@ 2024-11-14  1:22 Yuanchu Xie
  2024-11-14 10:53 ` Alejandro Colomar
  0 siblings, 1 reply; 2+ messages in thread
From: Yuanchu Xie @ 2024-11-14  1:22 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: Andrew Morton, Yu Zhao, linux-man, Yuanchu Xie, T.J. Alumbaugh

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: <https://lore.kernel.org/linux-mm/20221230215252.2628425-2-yuzhao@google.com/>
Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
Signed-off-by: Yuanchu Xie <yuanchu@google.com>
---
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/20230320222057.1976956-1-talumbau@google.com/
v4: https://lore.kernel.org/linux-man/20241113031654.3964740-1-yuanchu@google.com/

 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 ed40b0c0d..3c47efeb8 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.
+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
-- 
2.46.0


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

* Re: [PATCH v5] posix_fadvise.2: POSIX_FADV_NOREUSE now supported.
  2024-11-14  1:22 [PATCH v5] posix_fadvise.2: POSIX_FADV_NOREUSE now supported Yuanchu Xie
@ 2024-11-14 10:53 ` Alejandro Colomar
  0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2024-11-14 10:53 UTC (permalink / raw)
  To: Yuanchu Xie
  Cc: Alejandro Colomar, Andrew Morton, Yu Zhao, linux-man,
	T.J. Alumbaugh

[-- Attachment #1: Type: text/plain, Size: 2611 bytes --]

Hi Yuanchu,

On Wed, Nov 13, 2024 at 05:22:33PM GMT, Yuanchu Xie wrote:
> 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: <https://lore.kernel.org/linux-mm/20221230215252.2628425-2-yuzhao@google.com/>
> Signed-off-by: T.J. Alumbaugh <talumbau@google.com>
> Signed-off-by: Yuanchu Xie <yuanchu@google.com>
> ---
> 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/20230320222057.1976956-1-talumbau@google.com/
> v4: https://lore.kernel.org/linux-man/20241113031654.3964740-1-yuanchu@google.com/
> 
>  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 ed40b0c0d..3c47efeb8 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.
> +From Linux 6.3 and beyond,

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

	Since Linux 6.3,

> +.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

> +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.46.0
> 

-- 
<https://www.alejandro-colomar.es/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2024-11-14 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14  1:22 [PATCH v5] posix_fadvise.2: POSIX_FADV_NOREUSE now supported Yuanchu Xie
2024-11-14 10:53 ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox