linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Davide Libenzi <davidel@xmailserver.org>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Joern Engel <joern@logfs.org>, Jianguo Wu <wujianguo@huawei.com>,
	Eric B Munson <emunson@akamai.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-doc@vger.kernel.org
Subject: [patch -mm] mm, doc: cleanup and clarify munmap behavior for hugetlb memory fix
Date: Thu, 2 Apr 2015 15:50:15 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.10.1504021547330.15536@chino.kir.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1504021536210.15536@chino.kir.corp.google.com>

Don't only specify munmap(2) behavior with respect the hugetlb memory, all 
other syscalls get naturally aligned to the native page size of the 
processor.  Rather, pick out munmap(2) as a specific example.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 Documentation/vm/hugetlbpage.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 1270fb1..030977f 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -313,8 +313,11 @@ into /proc/sys/vm/hugetlb_shm_group.  It is possible for same or different
 applications to use any combination of mmaps and shm* calls, though the mount of
 filesystem will be required for using mmap calls without MAP_HUGETLB.
 
-When using munmap(2) to unmap hugetlb memory, the length specified must be
-hugepage aligned, otherwise it will fail with errno set to EINVAL.
+Syscalls that operate on memory backed by hugetlb pages only have their lengths
+aligned to the native page size of the processor; they will normally fail with
+errno set to EINVAL or exclude hugetlb pages that extend beyond the length if
+not hugepage aligned.  For example, munmap(2) will fail if memory is backed by
+a hugetlb page and the length is smaller than the hugepage size.
 
 
 Examples

  reply	other threads:[~2015-04-02 22:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 23:23 [patch 1/2] mm, doc: cleanup and clarify munmap behavior for hugetlb memory David Rientjes
2015-03-26 23:23 ` [patch 2/2] mm, selftests: test return value of munmap for MAP_HUGETLB memory David Rientjes
2015-03-26 23:52   ` Michael Ellerman
2015-03-27 13:58 ` [patch 1/2] mm, doc: cleanup and clarify munmap behavior for hugetlb memory Eric B Munson
2015-03-28  1:37   ` David Rientjes
2015-03-30  1:35 ` Hugh Dickins
2015-03-30 14:23   ` Eric B Munson
2015-03-30 20:23     ` Hugh Dickins
2015-04-02 22:40   ` David Rientjes
2015-04-02 22:50     ` David Rientjes [this message]
2015-04-03  1:05       ` [patch -mm] mm, doc: cleanup and clarify munmap behavior for hugetlb memory fix Hugh Dickins
2015-04-04  9:34       ` Jonathan Corbet
2015-04-09 19:46         ` David Rientjes
2015-04-11 13:26           ` Jonathan Corbet
     [not found] <057a01d06ddd$ff2550e0$fd6ff2a0$@alibaba-inc.com>
2015-04-03  7:18 ` Hillf Danton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1504021547330.15536@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=davidel@xmailserver.org \
    --cc=emunson@akamai.com \
    --cc=hughd@google.com \
    --cc=joern@logfs.org \
    --cc=lcapitulino@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuahkh@osg.samsung.com \
    --cc=wujianguo@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).