OSDN Git Service

(split) LDP: Update original to LDP v3.65
[linuxjm/LDP_man-pages.git] / original / man2 / madvise.2
index 03ca249..1c208bf 100644 (file)
@@ -1,7 +1,6 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
-.\" Copyright (C) 2001 David Gómez <davidge@jazzfree.com>
+.\" Copyright (C) 2001 David Gómez <davidge@jazzfree.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -21,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Based on comments from mm/filemap.c. Last modified on 10-06-2001
 .\" Modified, 25 Feb 2002, Michael Kerrisk, <mtk.manpages@gmail.com>
@@ -32,7 +32,7 @@
 .\" 2011-09-18, Doug Goldstein <cardoe@cardoe.com>
 .\"     Document MADV_HUGEPAGE and MADV_NOHUGEPAGE
 .\"
-.TH MADVISE 2 2012-04-28 "Linux" "Linux Programmer's Manual"
+.TH MADVISE 2 2014-04-20 "Linux" "Linux Programmer's Manual"
 .SH NAME
 madvise \- give advice about use of memory
 .SH SYNOPSIS
@@ -98,12 +98,12 @@ either in reloading of the memory contents from the underlying mapped file
 or zero-fill-on-demand pages for mappings
 without an underlying file.
 .TP
-.BR MADV_REMOVE " (Since Linux 2.6.16)"
+.BR MADV_REMOVE " (since Linux 2.6.16)"
 Free up a given range of pages
 and its associated backing store.
 Currently,
 .\" 2.6.18-rc5
-only shmfs/tmpfs supports this; other file systems return with the
+only shmfs/tmpfs supports this; other filesystems return with the
 error
 .BR ENOSYS .
 .\" Databases want to use this feature to drop a section of their
@@ -111,7 +111,7 @@ error
 .\" disk/swap space.  This feature is also useful for supporting
 .\" hot-plug memory on UML.
 .TP
-.BR MADV_DONTFORK " (Since Linux 2.6.16)"
+.BR MADV_DONTFORK " (since Linux 2.6.16)"
 .\" See http://lwn.net/Articles/171941/
 Do not make the pages in this range available to the child after a
 .BR fork (2).
@@ -142,25 +142,25 @@ DMAs into the page(s).)
 .\" SEE ALSO: http://lwn.net/Articles/171941/
 .\" "Tweaks to madvise() and posix_fadvise()", 14 Feb 2006
 .TP
-.BR MADV_DOFORK " (Since Linux 2.6.16)"
+.BR MADV_DOFORK " (since Linux 2.6.16)"
 Undo the effect of
 .BR MADV_DONTFORK ,
 restoring the default behavior, whereby a mapping is inherited across
 .BR fork (2).
 .TP
-.BR MADV_HWPOISON " (Since Linux 2.6.32)
+.BR MADV_HWPOISON " (since Linux 2.6.32)
 Poison a page and handle it like a hardware memory corruption.
-This operation is only available for privileged
+This operation is available only for privileged
 .RB ( CAP_SYS_ADMIN )
 processes.
 This operation may result in the calling process receiving a
 .B SIGBUS
 and the page being unmapped.
 This feature is intended for testing of memory error-handling code;
-it is only available if the kernel was configured with
+it is available only if the kernel was configured with
 .BR CONFIG_MEMORY_FAILURE .
 .TP
-.BR MADV_SOFT_OFFLINE " (Since Linux 2.6.33)
+.BR MADV_SOFT_OFFLINE " (since Linux 2.6.33)
 Soft offline the pages in the range specified by
 .I addr
 and
@@ -175,7 +175,7 @@ The effect of the
 operation is invisible to (i.e., does not change the semantics of)
 the calling process.
 This feature is intended for testing of memory error-handling code;
-it is only available if the kernel was configured with
+it is available only if the kernel was configured with
 .BR CONFIG_MEMORY_FAILURE .
 .TP
 .BR MADV_MERGEABLE " (since Linux 2.6.32)"
@@ -188,19 +188,19 @@ been marked as mergeable,
 looking for pages with identical content.
 These are replaced by a single write-protected page (which is automatically
 copied if a process later wants to update the content of the page).
-KSM only merges private anonymous pages (see
+KSM merges only private anonymous pages (see
 .BR mmap (2)).
 The KSM feature is intended for applications that generate many
 instances of the same data (e.g., virtualization systems such as KVM).
 It can consume a lot of processing power; use with care.
-See the kernel source file
+See the Linux kernel source file
 .I Documentation/vm/ksm.txt
 for more details.
 The
 .BR MADV_MERGEABLE
 and
 .BR MADV_UNMERGEABLE
-operations are only available if the kernel was configured with
+operations are available only if the kernel was configured with
 .BR CONFIG_KSM .
 .TP
 .BR MADV_UNMERGEABLE " (since Linux 2.6.32)"
@@ -219,7 +219,7 @@ Enables Transparent Huge Pages (THP) for pages in the range specified by
 .I addr
 and
 .IR length .
-Currently, Transparent Huge Pages only work with private anonymous pages (see
+Currently, Transparent Huge Pages work only with private anonymous pages (see
 .BR mmap (2)).
 The kernel will regularly scan the areas marked as huge page candidates
 to replace them with huge pages.
@@ -231,14 +231,14 @@ data and access large regions of that memory at a time (e.g., virtualization
 systems such as QEMU).
 It can very easily waste memory (e.g., a 2MB mapping that only ever accesses
 1 byte will result in 2MB of wired memory instead of one 4KB page).
-See the kernel source file
+See the Linux kernel source file
 .I Documentation/vm/transhuge.txt
 for more details.
 The
 .BR MADV_HUGEPAGE
 and
 .BR MADV_NOHUGEPAGE
-operations are only available if the kernel was configured with
+operations are available only if the kernel was configured with
 .BR CONFIG_TRANSPARENT_HUGEPAGE .
 .TP
 .BR MADV_NOHUGEPAGE " (since Linux 2.6.38)"
@@ -265,7 +265,7 @@ file (see
 .BR MADV_DODUMP " (since Linux 3.4)"
 Undo the effect of an earlier
 .BR MADV_DONTDUMP .
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 On success
 .BR madvise ()
 returns zero.
@@ -322,14 +322,15 @@ Not enough memory: paging in failed.
 .B ENOMEM
 Addresses in the specified range are not currently
 mapped, or are outside the address space of the process.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 POSIX.1b.
 POSIX.1-2001 describes
 .BR posix_madvise (3)
 .\" FIXME . Write a posix_madvise(3) page.
 with constants
 .BR POSIX_MADV_NORMAL ,
-etc.,
+.BR POSIX_MADV_RANDOM ,
+and so on,
 with a behavior close to that described here.
 There is a similar
 .BR posix_fadvise (2)
@@ -344,7 +345,7 @@ and
 .BR MADV_UNMERGEABLE
 are Linux-specific.
 .SH NOTES
-.SS "Linux Notes"
+.SS Linux notes
 .LP
 The current Linux implementation (2.4.0) views this system call
 more as a command than as advice and hence may return an error
@@ -368,11 +369,20 @@ from the system call, as it should).
 .\" The
 .\" .BR madvise ()
 .\" function first appeared in 4.4BSD.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR getrlimit (2),
 .BR mincore (2),
 .BR mmap (2),
 .BR mprotect (2),
 .BR msync (2),
 .BR munmap (2),
+.BR prctl (2),
 .BR core (5)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.