linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, page_alloc: skip zone who has no managed_pages in calculate_totalreserve_pages()
@ 2018-11-12  7:14 Wei Yang
  2018-11-12  8:09 ` Michal Hocko
  2018-11-13  3:11 ` [PATCH] mm, page_alloc: skip to set lowmem_reserve[] for empty zones Wei Yang
  0 siblings, 2 replies; 14+ messages in thread
From: Wei Yang @ 2018-11-12  7:14 UTC (permalink / raw)
  To: akpm, mhocko; +Cc: mgorman, linux-mm, Wei Yang

Zone with no managed_pages doesn't contribute totalreserv_pages. And the
more nodes we have, the more empty zones there are.

This patch skip the zones to save some cycles.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/page_alloc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a919ba5cb3c8..567de15e1106 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7246,6 +7246,9 @@ static void calculate_totalreserve_pages(void)
 			struct zone *zone = pgdat->node_zones + i;
 			long max = 0;
 
+			if (!managed_zone(zone))
+				continue;
+
 			/* Find valid and maximum lowmem_reserve in the zone */
 			for (j = i; j < MAX_NR_ZONES; j++) {
 				if (zone->lowmem_reserve[j] > max)
-- 
2.15.1

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

end of thread, other threads:[~2018-11-14  8:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12  7:14 [PATCH] mm, page_alloc: skip zone who has no managed_pages in calculate_totalreserve_pages() Wei Yang
2018-11-12  8:09 ` Michal Hocko
2018-11-12 14:26   ` Wei Yang
2018-11-12 14:40     ` Michal Hocko
2018-11-13  1:39       ` Wei Yang
2018-11-13  8:08         ` Michal Hocko
2018-11-13  8:16           ` Wei Yang
2018-11-13  9:07             ` Michal Hocko
2018-11-13  9:14               ` Wei Yang
2018-11-14  7:43               ` Wei Yang
2018-11-14  7:48                 ` Michal Hocko
2018-11-14  8:20                   ` Wei Yang
2018-11-14  8:54                     ` Michal Hocko
2018-11-13  3:11 ` [PATCH] mm, page_alloc: skip to set lowmem_reserve[] for empty zones Wei Yang

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