All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-mempolicy-enable-page-allocation-for-mpol_preferred_many-for-general-cases.patch added to -mm tree
@ 2021-07-15  0:17 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-07-15  0:17 UTC (permalink / raw)
  To: aarcange, ak, ben.widawsky, dan.j.williams, dave.hansen,
	feng.tang, mgorman, mhocko, mhocko, mike.kravetz, mm-commits,
	rdunlap, rientjes, vbabka, ying.huang


The patch titled
     Subject: mm/mempolicy: enable page allocation for MPOL_PREFERRED_MANY for general cases
has been added to the -mm tree.  Its filename is
     mm-mempolicy-enable-page-allocation-for-mpol_preferred_many-for-general-cases.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-mempolicy-enable-page-allocation-for-mpol_preferred_many-for-general-cases.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-mempolicy-enable-page-allocation-for-mpol_preferred_many-for-general-cases.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Ben Widawsky <ben.widawsky@intel.com>
Subject: mm/mempolicy: enable page allocation for MPOL_PREFERRED_MANY for general cases

In order to support MPOL_PREFERRED_MANY which is used by set_mempolicy(2),
mbind(2), enable both alloc_pages() and alloc_pages_vma() by using
alloc_page_preferred_many().

Link: https://lkml.kernel.org/r/1626077374-81682-4-git-send-email-feng.tang@intel.com
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/mempolicy.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/mm/mempolicy.c~mm-mempolicy-enable-page-allocation-for-mpol_preferred_many-for-general-cases
+++ a/mm/mempolicy.c
@@ -2207,6 +2207,12 @@ struct page *alloc_pages_vma(gfp_t gfp,
 		goto out;
 	}
 
+	if (pol->mode == MPOL_PREFERRED_MANY) {
+		page = alloc_page_preferred_many(gfp, order, pol);
+		mpol_cond_put(pol);
+		goto out;
+	}
+
 	if (unlikely(IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && hugepage)) {
 		int hpage_node = node;
 
@@ -2286,6 +2292,8 @@ struct page *alloc_pages(gfp_t gfp, unsi
 	 */
 	if (pol->mode == MPOL_INTERLEAVE)
 		page = alloc_page_interleave(gfp, order, interleave_nodes(pol));
+	else if (pol->mode == MPOL_PREFERRED_MANY)
+		page = alloc_page_preferred_many(gfp, order, pol);
 	else
 		page = __alloc_pages(gfp, order,
 				policy_node(gfp, pol, numa_node_id()),
_

Patches currently in -mm which might be from ben.widawsky@intel.com are

mm-mempolicy-enable-page-allocation-for-mpol_preferred_many-for-general-cases.patch
mm-hugetlb-add-support-for-mempolicy-mpol_preferred_many.patch
mm-mempolicy-advertise-new-mpol_preferred_many.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-15  0:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15  0:17 + mm-mempolicy-enable-page-allocation-for-mpol_preferred_many-for-general-cases.patch added to -mm tree akpm

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.