diff options
author | Yang Shi <yang.s@alibaba-inc.com> | 2017-10-13 18:57:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-13 19:18:32 -0400 |
commit | c02c30093254189a6ef55fed415a4ffb55a74cdf (patch) | |
tree | 2294769fc18dd294e23aa2b1dc4d842d620c87d5 | |
parent | cc3fa84045694c2fd7ccf6ce84dee5cba372a7d3 (diff) |
mm/madvise.c: add description for MADV_WIPEONFORK and MADV_KEEPONFORK
mm/madvise.c has a brief description about all MADV_ flags. Add a
description for the newly added MADV_WIPEONFORK and MADV_KEEPONFORK.
Although man page has the similar information, but it'd better to keep
the consistent with other flags.
Link: http://lkml.kernel.org/r/1506117328-88228-1-git-send-email-yang.s@alibaba-inc.com
Signed-off-by: Yang Shi <yang.s@alibaba-inc.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/madvise.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/madvise.c b/mm/madvise.c index 25bade36e9ca..fd70d6aabc3e 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -757,6 +757,9 @@ madvise_behavior_valid(int behavior) | |||
757 | * MADV_DONTFORK - omit this area from child's address space when forking: | 757 | * MADV_DONTFORK - omit this area from child's address space when forking: |
758 | * typically, to avoid COWing pages pinned by get_user_pages(). | 758 | * typically, to avoid COWing pages pinned by get_user_pages(). |
759 | * MADV_DOFORK - cancel MADV_DONTFORK: no longer omit this area when forking. | 759 | * MADV_DOFORK - cancel MADV_DONTFORK: no longer omit this area when forking. |
760 | * MADV_WIPEONFORK - present the child process with zero-filled memory in this | ||
761 | * range after a fork. | ||
762 | * MADV_KEEPONFORK - undo the effect of MADV_WIPEONFORK | ||
760 | * MADV_HWPOISON - trigger memory error handler as if the given memory range | 763 | * MADV_HWPOISON - trigger memory error handler as if the given memory range |
761 | * were corrupted by unrecoverable hardware memory failure. | 764 | * were corrupted by unrecoverable hardware memory failure. |
762 | * MADV_SOFT_OFFLINE - try to soft-offline the given range of memory. | 765 | * MADV_SOFT_OFFLINE - try to soft-offline the given range of memory. |
@@ -777,7 +780,9 @@ madvise_behavior_valid(int behavior) | |||
777 | * zero - success | 780 | * zero - success |
778 | * -EINVAL - start + len < 0, start is not page-aligned, | 781 | * -EINVAL - start + len < 0, start is not page-aligned, |
779 | * "behavior" is not a valid value, or application | 782 | * "behavior" is not a valid value, or application |
780 | * is attempting to release locked or shared pages. | 783 | * is attempting to release locked or shared pages, |
784 | * or the specified address range includes file, Huge TLB, | ||
785 | * MAP_SHARED or VMPFNMAP range. | ||
781 | * -ENOMEM - addresses in the specified range are not currently | 786 | * -ENOMEM - addresses in the specified range are not currently |
782 | * mapped, or are outside the AS of the process. | 787 | * mapped, or are outside the AS of the process. |
783 | * -EIO - an I/O error occurred while paging in data. | 788 | * -EIO - an I/O error occurred while paging in data. |