linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: madvise: add description for MADV_WIPEONFORK and MADV_KEEPONFORK
@ 2017-09-22 21:55 Yang Shi
  2017-09-22 23:07 ` Rik van Riel
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Shi @ 2017-09-22 21:55 UTC (permalink / raw)
  To: riel; +Cc: Yang Shi, linux-mm, linux-kernel

mm/madvise.c has the brief description about all MADV_ flags, added the
description for the newly added MADV_WIPEONFORK and MADV_KEEPONFORK.

Although man page has the similar information, but it'd better to keep the
consistency with other flags.

Signed-off-by: Yang Shi <yang.s@alibaba-inc.com>
---
 mm/madvise.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mm/madvise.c b/mm/madvise.c
index 21261ff..c6bf572 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -749,6 +749,9 @@ static int madvise_inject_error(int behavior,
  *  MADV_DONTFORK - omit this area from child's address space when forking:
  *		typically, to avoid COWing pages pinned by get_user_pages().
  *  MADV_DOFORK - cancel MADV_DONTFORK: no longer omit this area when forking.
+ *  MADV_WIPEONFORK - present the child process with zero-filled memory in this
+ *              range after a fork.
+ *  MADV_KEEPONFORK - undo the effect of MADV_WIPEONFORK
  *  MADV_HWPOISON - trigger memory error handler as if the given memory range
  *		were corrupted by unrecoverable hardware memory failure.
  *  MADV_SOFT_OFFLINE - try to soft-offline the given range of memory.
@@ -769,7 +772,9 @@ static int madvise_inject_error(int behavior,
  *  zero    - success
  *  -EINVAL - start + len < 0, start is not page-aligned,
  *		"behavior" is not a valid value, or application
- *		is attempting to release locked or shared pages.
+ *		is attempting to release locked or shared pages,
+ *		or the specified address range includes file, Huge TLB,
+ *		MAP_SHARED or VMPFNMAP range.
  *  -ENOMEM - addresses in the specified range are not currently
  *		mapped, or are outside the AS of the process.
  *  -EIO    - an I/O error occurred while paging in data.
-- 
1.8.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: madvise: add description for MADV_WIPEONFORK and MADV_KEEPONFORK
  2017-09-22 21:55 [PATCH] mm: madvise: add description for MADV_WIPEONFORK and MADV_KEEPONFORK Yang Shi
@ 2017-09-22 23:07 ` Rik van Riel
  0 siblings, 0 replies; 2+ messages in thread
From: Rik van Riel @ 2017-09-22 23:07 UTC (permalink / raw)
  To: Yang Shi; +Cc: linux-mm, linux-kernel

On Sat, 2017-09-23 at 05:55 +0800, Yang Shi wrote:
> mm/madvise.c has the brief description about all MADV_ flags, added
> the
> description for the newly added MADV_WIPEONFORK and MADV_KEEPONFORK.
> 
> Although man page has the similar information, but it'd better to
> keep the
> consistency with other flags.
> 
> Signed-off-by: Yang Shi <yang.s@alibaba-inc.com>
> 
Thank you for spotting that I missed a location!

Reviewed-by: Rik van Riel <riel@redhat.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2017-09-22 23:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22 21:55 [PATCH] mm: madvise: add description for MADV_WIPEONFORK and MADV_KEEPONFORK Yang Shi
2017-09-22 23:07 ` Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).