From: Eric B Munson <ebmunson@us.ibm.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
stable@kernel.org,
Linux Memory Management List <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
Lee Schermerhorn <Lee.Schermerhorn@hp.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
starlight@binnacle.cx, Adam Litke <agl@us.ibm.com>,
Andy Whitcroft <apw@canonical.com>,
wli@movementarian.org
Subject: Re: [PATCH 2/2] mm: Account for MAP_SHARED mappings using VM_MAYSHARE and not VM_SHARED in hugetlbfs
Date: Wed, 27 May 2009 17:40:25 +0100 [thread overview]
Message-ID: <20090527164025.GC5145@us.ibm.com> (raw)
In-Reply-To: <1243422749-6256-3-git-send-email-mel@csn.ul.ie>
[-- Attachment #1: Type: text/plain, Size: 1655 bytes --]
On Wed, 27 May 2009, Mel Gorman wrote:
> hugetlbfs reserves huge pages but does not fault them at mmap() time to ensure
> that future faults succeed. The reservation behaviour differs depending on
> whether the mapping was mapped MAP_SHARED or MAP_PRIVATE. For MAP_SHARED
> mappings, hugepages are reserved when mmap() is first called and are tracked
> based on information associated with the inode. Other processes mapping
> MAP_SHARED use the same reservation. MAP_PRIVATE track the reservations
> based on the VMA created as part of the mmap() operation. Each process
> mapping MAP_PRIVATE must make its own reservation.
>
> hugetlbfs currently checks if a VMA is MAP_SHARED with the VM_SHARED flag and
> not VM_MAYSHARE. For file-backed mappings, such as hugetlbfs, VM_SHARED is
> set only if the mapping is MAP_SHARED and the file was opened read-write. If a
> shared memory mapping was mapped shared-read-write for populating of data and
> mapped shared-read-only by other processes, then hugetlbfs would account for
> the mapping as if it was MAP_PRIVATE. This causes processes to fail to map
> the file MAP_SHARED even though it should succeed as the reservation is there.
>
> This patch alters mm/hugetlb.c and replaces VM_SHARED with VM_MAYSHARE when
> the intent of the code was to check whether the VMA was mapped MAP_SHARED
> or MAP_PRIVATE.
>
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
I tested this patch on both x86_64 and ppc64 using 2.6.30-rc7 with the libhugetlbfs
test suite and everything looks good.
Acked-by: Eric B Munson <ebmunson@us.ibm.com>
Tested-by: Eric B Munson <ebmunson@us.ibm.com>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-05-27 16:39 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 11:12 [PATCH 0/2] Fixes for hugetlbfs-related problems on shared memory Mel Gorman
2009-05-27 11:12 ` Mel Gorman
2009-05-27 11:12 ` [PATCH 1/2] x86: Ignore VM_LOCKED when determining if hugetlb-backed page tables can be shared or not Mel Gorman
2009-05-27 11:12 ` Mel Gorman
2009-05-27 16:38 ` Eric B Munson
2009-05-27 23:18 ` Ingo Molnar
2009-05-27 23:18 ` Ingo Molnar
2009-05-28 8:55 ` Mel Gorman
2009-05-28 8:55 ` Mel Gorman
2009-05-27 11:12 ` [PATCH 2/2] mm: Account for MAP_SHARED mappings using VM_MAYSHARE and not VM_SHARED in hugetlbfs Mel Gorman
2009-05-27 11:12 ` Mel Gorman
2009-05-27 16:40 ` Eric B Munson [this message]
2009-05-27 20:14 ` [PATCH 0/2] Fixes for hugetlbfs-related problems on shared memory Andrew Morton
2009-05-27 20:14 ` Andrew Morton
2009-05-27 23:19 ` Ingo Molnar
2009-05-27 23:19 ` Ingo Molnar
2009-06-16 0:19 ` QUESTION: can netdev_alloc_skb() errors be reduced by tuning? starlight
2009-06-16 0:19 ` starlight
2009-06-16 2:26 ` Eric Dumazet
2009-06-16 2:26 ` Eric Dumazet
2009-06-16 4:12 ` starlight
2009-06-16 4:12 ` starlight
2009-06-16 6:12 ` Eric Dumazet
2009-06-16 6:12 ` Eric Dumazet
2009-06-16 6:12 ` Eric Dumazet
2009-07-05 3:44 ` Herbert Xu
2009-07-05 3:44 ` Herbert Xu
2009-07-05 3:44 ` Herbert Xu
2009-06-16 9:19 ` Mel Gorman
2009-06-16 9:19 ` Mel Gorman
2009-06-16 15:25 ` starlight
2009-06-16 15:25 ` starlight
2009-05-28 8:56 ` [PATCH 0/2] Fixes for hugetlbfs-related problems on shared memory Mel Gorman
2009-05-28 8:56 ` Mel Gorman
2009-06-08 1:25 ` starlight
2009-06-08 1:25 ` starlight
2009-06-08 10:24 ` Mel Gorman
2009-06-08 10:24 ` Mel Gorman
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=20090527164025.GC5145@us.ibm.com \
--to=ebmunson@us.ibm.com \
--cc=Lee.Schermerhorn@hp.com \
--cc=agl@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=hugh.dickins@tiscali.co.uk \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=mingo@elte.hu \
--cc=stable@kernel.org \
--cc=starlight@binnacle.cx \
--cc=wli@movementarian.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.