From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com [209.85.223.172]) by kanga.kvack.org (Postfix) with ESMTP id EB2626B0038 for ; Thu, 2 Apr 2015 18:50:17 -0400 (EDT) Received: by ierf6 with SMTP id f6so80201212ier.2 for ; Thu, 02 Apr 2015 15:50:17 -0700 (PDT) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com. [2607:f8b0:4001:c05::22d]) by mx.google.com with ESMTPS id d15si5637266ioe.23.2015.04.02.15.50.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2015 15:50:17 -0700 (PDT) Received: by igbud6 with SMTP id ud6so89075223igb.1 for ; Thu, 02 Apr 2015 15:50:17 -0700 (PDT) Date: Thu, 2 Apr 2015 15:50:15 -0700 (PDT) From: David Rientjes Subject: [patch -mm] mm, doc: cleanup and clarify munmap behavior for hugetlb memory fix In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Hugh Dickins , Jonathan Corbet , Davide Libenzi , Luiz Capitulino , Shuah Khan , Andrea Arcangeli , Joern Engel , Jianguo Wu , Eric B Munson , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org 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 --- 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 -- 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: email@kvack.org