All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Interface for higher order contiguous allocations
@ 2018-02-12 22:20 ` Mike Kravetz
  0 siblings, 0 replies; 19+ messages in thread
From: Mike Kravetz @ 2018-02-12 22:20 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Michal Hocko, Christopher Lameter, Guy Shattah,
	Anshuman Khandual, Michal Nazarewicz, Vlastimil Babka,
	David Nellans, Laura Abbott, Pavel Machek, Dave Hansen,
	Mike Kravetz

These patches came out of the "[RFC] mmap(MAP_CONTIG)" discussions at:
http://lkml.kernel.org/r/21f1ec96-2822-1189-1c95-79a2bb491571@oracle.com

One suggestion in that thread was to create a friendlier interface that
could be used by drivers and others outside core mm code to allocate a
contiguous set of pages.  The alloc_contig_range() interface is used for
this purpose today by CMA and gigantic page allocation.  However, this is
not a general purpose interface.  So, wrap alloc_contig_range() in the
more general interface:

struct page *find_alloc_contig_pages(unsigned int order, gfp_t gfp, int nid,
					nodemask_t *nodemask)

No underlying changes are made to increase the likelihood that a contiguous
set of pages can be found and allocated.  Therefore, any user of this
interface must deal with failure.  The hope is that this interface will be
able to satisfy some use cases today.

If the "rate of failure" is too high to be useful, then more work can be put
into methods to help increase the rate of successful allocations.  Such a
proposal was recently sent by Christoph Lameter "[RFC] Protect larger order
pages from breaking up":
http://lkml.kernel.org/r/alpine.DEB.2.20.1802091311090.3059@nuc-kabylake

find_alloc_contig_pages() uses the same logic that exists today for scanning
zones to look for contiguous ranges suitable for gigantic pages.  The last
patch in the series changes gigantic page allocation to use the new interface.

Mike Kravetz (3):
  mm: make start_isolate_page_range() fail if already isolated
  mm: add find_alloc_contig_pages() interface
  mm/hugetlb: use find_alloc_contig_pages() to allocate gigantic pages

 include/linux/gfp.h | 12 +++++++
 mm/hugetlb.c        | 88 ++++--------------------------------------------
 mm/page_alloc.c     | 97 +++++++++++++++++++++++++++++++++++++++++++++++++----
 mm/page_isolation.c | 10 +++++-
 4 files changed, 118 insertions(+), 89 deletions(-)

-- 
2.13.6

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

end of thread, other threads:[~2018-04-16 13:14 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 22:20 [RFC PATCH 0/3] Interface for higher order contiguous allocations Mike Kravetz
2018-02-12 22:20 ` Mike Kravetz
2018-02-12 22:20 ` [RFC PATCH 1/3] mm: make start_isolate_page_range() fail if already isolated Mike Kravetz
2018-02-12 22:20   ` Mike Kravetz
2018-02-13  9:46   ` Mike Rapoport
2018-02-13  9:46     ` Mike Rapoport
2018-02-16  0:40   ` Mike Kravetz
2018-02-16  0:40     ` Mike Kravetz
2018-02-12 22:20 ` [RFC PATCH 2/3] mm: add find_alloc_contig_pages() interface Mike Kravetz
2018-02-12 22:20   ` Mike Kravetz
2018-02-13  9:53   ` Mike Rapoport
2018-02-13  9:53     ` Mike Rapoport
2018-02-12 22:20 ` [RFC PATCH 3/3] mm/hugetlb: use find_alloc_contig_pages() to allocate gigantic pages Mike Kravetz
2018-02-12 22:20   ` Mike Kravetz
2018-02-15 20:22 ` [RFC PATCH 0/3] Interface for higher order contiguous allocations Reinette Chatre
2018-02-15 20:22   ` Reinette Chatre
2018-04-12 20:40   ` Reinette Chatre
2018-04-12 20:58     ` Mike Kravetz
2018-04-16 13:14       ` Michal Hocko

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.