linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] hugetlb: If PMD sharing is possible, align to PUD_SIZE
@ 2016-03-29  1:12 Mike Kravetz
  2016-03-29  1:12 ` [RFC PATCH 1/2] mm/hugetlbfs: Attempt PUD_SIZE mapping alignment if PMD sharing enabled Mike Kravetz
  2016-03-29  1:12 ` [RFC PATCH 2/2] x86/hugetlb: " Mike Kravetz
  0 siblings, 2 replies; 12+ messages in thread
From: Mike Kravetz @ 2016-03-29  1:12 UTC (permalink / raw)
  To: linux-mm, linux-kernel, x86
  Cc: Hugh Dickins, Naoya Horiguchi, Hillf Danton, Kirill A. Shutemov,
	David Rientjes, Dave Hansen, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, Catalin Marinas, Will Deacon, Steve Capper,
	Andrew Morton, Mike Kravetz

PMD sharing for hugetlb mappings has been present for quite some time.  
However, specific conditions must be met for mappings to be shared.  
One of those conditions is that the mapping must include all pages that 
can be mapped by a PUD.  To help facilitate this, the mapping should be
PUD_SIZE aligned.  The only way for a user to get PUD_SIZE alignment is
to pass an address to mmap() or shmat().  If the user does not pass an 
address the mapping will be huge page size aligned.

To better utilize huge PMD sharing, attempt to PUD_SIZE align mappings
if the following conditions are met:
- Address passed to mmap or shmat is NULL
- The mapping is flaged as shared
- The mapping is at least PUD_SIZE in length
If a PUD_SIZE aligned mapping can not be created, then fall back to a
huge page size mapping.

Currently, only arm64 and x86 support PMD sharing.  x86 has 
HAVE_ARCH_HUGETLB_UNMAPPED_AREA (where code changes are made).  arm64
uses the architecture independent code.

Mike Kravetz (2):
  mm/hugetlbfs: Attempt PUD_SIZE mapping alignment if PMD sharing
    enabled
  x86/hugetlb: Attempt PUD_SIZE mapping alignment if PMD sharing enabled

 arch/x86/mm/hugetlbpage.c | 64 ++++++++++++++++++++++++++++++++++++++++++++---
 fs/hugetlbfs/inode.c      | 29 +++++++++++++++++++--
 2 files changed, 88 insertions(+), 5 deletions(-)

-- 
2.4.3

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-03-31 16:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-29  1:12 [RFC PATCH 0/2] hugetlb: If PMD sharing is possible, align to PUD_SIZE Mike Kravetz
2016-03-29  1:12 ` [RFC PATCH 1/2] mm/hugetlbfs: Attempt PUD_SIZE mapping alignment if PMD sharing enabled Mike Kravetz
2016-03-29  3:50   ` Hillf Danton
2016-03-29 16:29     ` Mike Kravetz
2016-03-31  2:18   ` Naoya Horiguchi
2016-03-31 16:45     ` Mike Kravetz
2016-03-29  1:12 ` [RFC PATCH 2/2] x86/hugetlb: " Mike Kravetz
2016-03-29  8:35   ` Ingo Molnar
2016-03-29 17:05     ` Mike Kravetz
2016-03-31  2:26       ` Naoya Horiguchi
2016-03-31 11:38         ` Ingo Molnar
2016-03-31 16:32         ` Mike Kravetz

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).