+ mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm, sparse, page_ext: drop ugly N_HIGH_MEMORY branches for allocations
has been added to the -mm tree.  Its filename is
     mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations.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/SubmitChecklist when testing your code ***

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

------------------------------------------------------
From: Michal Hocko <mhocko@xxxxxxxx>
Subject: mm, sparse, page_ext: drop ugly N_HIGH_MEMORY branches for allocations

f52407ce2dea ("memory hotplug: alloc page from other node in memory
online") has introduced N_HIGH_MEMORY checks to only use NUMA aware
allocations when there is some memory present because the respective node
might not have any memory yet at the time and so it could fail or even
OOM.  Things have changed since then though.  Zonelists are now always
initialized before we do any allocations even for hotplug (see
959ecc48fc75 ("mm/memory_hotplug.c: fix building of node hotplug
zonelist")).  Therefore these checks are not really needed.  In fact
caller of the allocator should never care about whether the node is
populated because that might change at any time.

Link: http://lkml.kernel.org/r/20170721143915.14161-10-mhocko@xxxxxxxxxx
Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>
Acked-by: Vlastimil Babka <vbabka@xxxxxxx>
Cc: Shaohua Li <shaohua.li@xxxxxxxxx>
Cc: Joonsoo Kim <js1304@xxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxx>
Cc: Toshi Kani <toshi.kani@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/page_ext.c       |    5 +----
 mm/sparse-vmemmap.c |   11 +++--------
 mm/sparse.c         |   10 +++-------
 3 files changed, 7 insertions(+), 19 deletions(-)

diff -puN mm/page_ext.c~mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations mm/page_ext.c
--- a/mm/page_ext.c~mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations
+++ a/mm/page_ext.c
@@ -222,10 +222,7 @@ static void *__meminit alloc_page_ext(si
 		return addr;
 	}
 
-	if (node_state(nid, N_HIGH_MEMORY))
-		addr = vzalloc_node(size, nid);
-	else
-		addr = vzalloc(size);
+	addr = vzalloc_node(size, nid);
 
 	return addr;
 }
diff -puN mm/sparse-vmemmap.c~mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations mm/sparse-vmemmap.c
--- a/mm/sparse-vmemmap.c~mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations
+++ a/mm/sparse-vmemmap.c
@@ -54,14 +54,9 @@ void * __meminit vmemmap_alloc_block(uns
 	if (slab_is_available()) {
 		struct page *page;
 
-		if (node_state(node, N_HIGH_MEMORY))
-			page = alloc_pages_node(
-				node, GFP_KERNEL | __GFP_ZERO | __GFP_RETRY_MAYFAIL,
-				get_order(size));
-		else
-			page = alloc_pages(
-				GFP_KERNEL | __GFP_ZERO | __GFP_RETRY_MAYFAIL,
-				get_order(size));
+		page = alloc_pages_node(node,
+			GFP_KERNEL | __GFP_ZERO | __GFP_RETRY_MAYFAIL,
+			get_order(size));
 		if (page)
 			return page_address(page);
 		return NULL;
diff -puN mm/sparse.c~mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations mm/sparse.c
--- a/mm/sparse.c~mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations
+++ a/mm/sparse.c
@@ -65,14 +65,10 @@ static noinline struct mem_section __ref
 	unsigned long array_size = SECTIONS_PER_ROOT *
 				   sizeof(struct mem_section);
 
-	if (slab_is_available()) {
-		if (node_state(nid, N_HIGH_MEMORY))
-			section = kzalloc_node(array_size, GFP_KERNEL, nid);
-		else
-			section = kzalloc(array_size, GFP_KERNEL);
-	} else {
+	if (slab_is_available())
+		section = kzalloc_node(array_size, GFP_KERNEL, nid);
+	else
 		section = memblock_virt_alloc_node(array_size, nid);
-	}
 
 	return section;
 }
_

Patches currently in -mm which might be from mhocko@xxxxxxxx are

mm-vmscan-do-not-loop-on-too_many_isolated-for-ever.patch
mm-memory_hotplug-display-allowed-zones-in-the-preferred-ordering.patch
mm-memory_hotplug-remove-zone-restrictions.patch
mm-page_alloc-rip-out-zonelist_order_zone.patch
mm-page_alloc-remove-boot-pageset-initialization-from-memory-hotplug.patch
mm-page_alloc-do-not-set_cpu_numa_mem-on-empty-nodes-initialization.patch
mm-memory_hotplug-drop-zone-from-build_all_zonelists.patch
mm-memory_hotplug-remove-explicit-build_all_zonelists-from-try_online_node.patch
mm-page_alloc-simplify-zonelist-initialization.patch
mm-page_alloc-remove-stop_machine-from-build_all_zonelists.patch
mm-memory_hotplug-get-rid-of-zonelists_mutex.patch
mm-sparse-page_ext-drop-ugly-n_high_memory-branches-for-allocations.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux