2022-03-17 05:45:56

by Charan Teja Kalla

[permalink] [raw]
Subject: [PATCH] madvise.2: update EINVAL return info

MADV_COLD and MADV_PAGEOUT advises on an address range which includes
locked, Huge TLB pages or VM_PFNMAP pages can return EINVAL. Update the
man pages accordingly.

Reported-by: Nadav Amit <[email protected]>
Signed-off-by: Charan Teja Reddy <[email protected]>
---
man2/madvise.2 | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/man2/madvise.2 b/man2/madvise.2
index f1f384c..ab98a87 100644
--- a/man2/madvise.2
+++ b/man2/madvise.2
@@ -505,6 +505,16 @@ is not a valid.
.B EINVAL
.I advice
is
+.BR MADV_COLD
+or
+.BR MADV_PAGEOUT
+and the specified address range includes locked, Huge TLB pages, or
+.B VM_PFNMAP
+pages.
+.TP
+.B EINVAL
+.I advice
+is
.B MADV_DONTNEED
or
.BR MADV_REMOVE
--
2.7.4


2022-03-17 21:35:24

by Alejandro Colomar

[permalink] [raw]
Subject: Re: [PATCH] madvise.2: update EINVAL return info

Hellp Charan,

On 3/16/22 15:52, Charan Teja Reddy wrote:
> MADV_COLD and MADV_PAGEOUT advises on an address range which includes
> locked, Huge TLB pages or VM_PFNMAP pages can return EINVAL. Update the
> man pages accordingly.
>
> Reported-by: Nadav Amit <[email protected]>
> Signed-off-by: Charan Teja Reddy <[email protected]>

Patch applied.

Thanks,

Alex

> ---
> man2/madvise.2 | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/man2/madvise.2 b/man2/madvise.2
> index f1f384c..ab98a87 100644
> --- a/man2/madvise.2
> +++ b/man2/madvise.2
> @@ -505,6 +505,16 @@ is not a valid.
> .B EINVAL
> .I advice
> is
> +.BR MADV_COLD
> +or
> +.BR MADV_PAGEOUT
> +and the specified address range includes locked, Huge TLB pages, or
> +.B VM_PFNMAP
> +pages.
> +.TP
> +.B EINVAL
> +.I advice
> +is
> .B MADV_DONTNEED
> or
> .BR MADV_REMOVE

--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/