From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752445AbbDCHTq (ORCPT ); Fri, 3 Apr 2015 03:19:46 -0400 Received: from mail113-250.mail.alibaba.com ([205.204.113.250]:46377 "EHLO us-alimail-mta2.hst.scl.en.alidc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751897AbbDCHTn (ORCPT ); Fri, 3 Apr 2015 03:19:43 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=r41f05022;MF=hillf.zj@alibaba-inc.com;PH=DS;RN=4;RT=4;SR=0; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "David Rientjes" Cc: , "linux-kernel" , "Andrew Morton" References: <057a01d06ddd$ff2550e0$fd6ff2a0$@alibaba-inc.com> In-Reply-To: <057a01d06ddd$ff2550e0$fd6ff2a0$@alibaba-inc.com> Subject: Re: [patch -mm] mm, doc: cleanup and clarify munmap behavior for hugetlb memory fix Date: Fri, 03 Apr 2015 15:18:50 +0800 Message-ID: <057b01d06dde$71738db0$545aa910$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJn9nDcsqVVxSplJYO0XRi//pK10JwLzySw Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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 > --- Acked-by: Hillf Danton > 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