All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <50C00259.50901@huawei.com>

diff --git a/a/2.txt b/N1/2.txt
index 8b13789..56fc0f0 100644
--- a/a/2.txt
+++ b/N1/2.txt
@@ -1 +1,134 @@
+>From 120759daa8410e1bf61d19210ddeb52ef32d002a Mon Sep 17 00:00:00 2001
+From: Jiang Liu <jiang.liu@huawei.com>
+Date: Wed, 5 Dec 2012 23:58:42 +0800
+Subject: [PATCH 3/6] page_alloc: Introduce zone_movable_limit[] to keep
+ movable limit for nodes
 
+This patch introduces a new array zone_movable_limit[] to store the
+ZONE_MOVABLE limit from movablecore_map boot option for all nodes.
+The function sanitize_zone_movable_limit() will find out to which
+node the ranges in movable_map.map[] belongs, and calculates the
+low boundary of ZONE_MOVABLE for each node.
+
+Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
+Reviewed-by: Wen Congyang <wency@cn.fujitsu.com>
+Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
+Tested-by: Lin Feng <linfeng@cn.fujitsu.com>
+
+page_alloc: Make movablecore_map has higher priority
+
+If kernelcore or movablecore is specified at the same time
+with movablecore_map, movablecore_map will have higher
+priority to be satisfied.
+This patch will make find_zone_movable_pfns_for_nodes()
+calculate zone_movable_pfn[] with the limit from
+zone_movable_limit[].
+
+Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
+Reviewed-by: Wen Congyang <wency@cn.fujitsu.com>
+Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
+Tested-by: Lin Feng <linfeng@cn.fujitsu.com>
+---
+ mm/page_alloc.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 65 insertions(+), 1 deletion(-)
+
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index e35ee27..41c3b51 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -4338,6 +4338,60 @@ static unsigned long __meminit zone_absent_pages_in_node(int nid,
+ 	return __absent_pages_in_range(nid, zone_start_pfn, zone_end_pfn);
+ }
+ 
++/**
++ * Try to figure out zone_movable_pfn[] from movablecore_map.
++ */
++static int __init find_zone_movable_from_movablecore_map(void)
++{
++	int map_pos = 0, i, nid;
++	unsigned long start_pfn, end_pfn;
++
++	if (!movablecore_map.nr_map)
++		return 0;
++
++	/* Iterate all ranges from minimum to maximum */
++	for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
++		/*
++		 * If we have found lowest pfn of ZONE_MOVABLE of the node
++		 * specified by user, just go on to check next range.
++		 */
++		if (zone_movable_pfn[nid])
++			continue;
++
++#ifdef CONFIG_HIGHMEM
++		/* Skip lowmem if ZONE_MOVABLE is highmem */
++		if (zone_movable_is_highmem() &&
++		    start_pfn < arch_zone_lowest_possible_pfn[ZONE_HIGHMEM])
++			start_pfn = arch_zone_lowest_possible_pfn[ZONE_HIGHMEM];
++		if (start_pfn > end_pfn)
++			continue;
++#endif
++
++		while (map_pos < movablecore_map.nr_map) {
++			if (end_pfn < movablecore_map.map[map_pos].start)
++				break;
++
++			if (start_pfn > movablecore_map.map[map_pos].end) {
++				map_pos++;
++				continue;
++			}
++
++			/*
++			 * The start_pfn of ZONE_MOVABLE is either the minimum
++			 * pfn specified by movablecore_map, or 0, which means
++			 * the node has no ZONE_MOVABLE.
++			 */
++			start_pfn = max(start_pfn,
++					movablecore_map.map[map_pos].start);
++			zone_movable_pfn[nid] = roundup(zone_movable_pfn[nid],
++							MAX_ORDER_NR_PAGES);
++			break;
++		}
++	}
++
++	return 1;
++}
++
+ #else /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
+ static inline unsigned long __meminit zone_spanned_pages_in_node(int nid,
+ 					unsigned long zone_type,
+@@ -4356,6 +4410,11 @@ static inline unsigned long __meminit zone_absent_pages_in_node(int nid,
+ 	return zholes_size[zone_type];
+ }
+ 
++static int __init find_zone_movable_from_movablecore_map(void)
++{
++	return 0;
++}
++
+ #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
+ 
+ static void __meminit calculate_node_totalpages(struct pglist_data *pgdat,
+@@ -4739,6 +4798,12 @@ static void __init find_zone_movable_pfns_for_nodes(void)
+ 	unsigned long totalpages = early_calculate_totalpages();
+ 	int usable_nodes = nodes_weight(node_states[N_HIGH_MEMORY]);
+ 
++	find_usable_zone_for_movable();
++
++	/* movablecore_map takes precedence over movablecore/kernelcore */
++	if (find_zone_movable_from_movablecore_map())
++		return;
++
+ 	/*
+ 	 * If movablecore was specified, calculate what size of
+ 	 * kernelcore that corresponds so that memory usable for
+@@ -4766,7 +4831,6 @@ static void __init find_zone_movable_pfns_for_nodes(void)
+ 		goto out;
+ 
+ 	/* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */
+-	find_usable_zone_for_movable();
+ 	usable_startpfn = arch_zone_lowest_possible_pfn[movable_zone];
+ 
+ restart:
+-- 
+1.7.9.5
diff --git a/a/content_digest b/N1/content_digest
index 3101e11..f23975b 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -7,22 +7,22 @@
  "Date\0Thu, 6 Dec 2012 10:26:33 +0800\0"
  "To\0Tang Chen <tangchen@cn.fujitsu.com>\0"
  "Cc\0Jiang Liu <liuj97@gmail.com>"
-  hpa@zytor.com
-  akpm@linux-foundation.org
-  rob@landley.net
-  isimatu.yasuaki@jp.fujitsu.com
-  laijs@cn.fujitsu.com
-  wency@cn.fujitsu.com
-  linfeng@cn.fujitsu.com
-  yinghai@kernel.org
-  kosaki.motohiro@jp.fujitsu.com
-  minchan.kim@gmail.com
-  mgorman@suse.de
-  rientjes@google.com
-  rusty@rustcorp.com.au
-  linux-kernel@vger.kernel.org
-  linux-mm@kvack.org
- " linux-doc@vger.kernel.org\0"
+  <hpa@zytor.com>
+  <akpm@linux-foundation.org>
+  <rob@landley.net>
+  <isimatu.yasuaki@jp.fujitsu.com>
+  <laijs@cn.fujitsu.com>
+  <wency@cn.fujitsu.com>
+  <linfeng@cn.fujitsu.com>
+  <yinghai@kernel.org>
+  <kosaki.motohiro@jp.fujitsu.com>
+  <minchan.kim@gmail.com>
+  <mgorman@suse.de>
+  <rientjes@google.com>
+  <rusty@rustcorp.com.au>
+  <linux-kernel@vger.kernel.org>
+  <linux-mm@kvack.org>
+ " <linux-doc@vger.kernel.org>\0"
  "\01:1\0"
  "b\0"
  "On 2012-12-6 9:26, Tang Chen wrote:\n"
@@ -149,5 +149,139 @@
  "\01:2\0"
  "fn\00003-page_alloc-Introduce-zone_movable_limit-to-keep-mova.patch\0"
  "b\0"
+ ">From 120759daa8410e1bf61d19210ddeb52ef32d002a Mon Sep 17 00:00:00 2001\n"
+ "From: Jiang Liu <jiang.liu@huawei.com>\n"
+ "Date: Wed, 5 Dec 2012 23:58:42 +0800\n"
+ "Subject: [PATCH 3/6] page_alloc: Introduce zone_movable_limit[] to keep\n"
+ " movable limit for nodes\n"
+ "\n"
+ "This patch introduces a new array zone_movable_limit[] to store the\n"
+ "ZONE_MOVABLE limit from movablecore_map boot option for all nodes.\n"
+ "The function sanitize_zone_movable_limit() will find out to which\n"
+ "node the ranges in movable_map.map[] belongs, and calculates the\n"
+ "low boundary of ZONE_MOVABLE for each node.\n"
+ "\n"
+ "Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>\n"
+ "Reviewed-by: Wen Congyang <wency@cn.fujitsu.com>\n"
+ "Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>\n"
+ "Tested-by: Lin Feng <linfeng@cn.fujitsu.com>\n"
+ "\n"
+ "page_alloc: Make movablecore_map has higher priority\n"
+ "\n"
+ "If kernelcore or movablecore is specified at the same time\n"
+ "with movablecore_map, movablecore_map will have higher\n"
+ "priority to be satisfied.\n"
+ "This patch will make find_zone_movable_pfns_for_nodes()\n"
+ "calculate zone_movable_pfn[] with the limit from\n"
+ "zone_movable_limit[].\n"
+ "\n"
+ "Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>\n"
+ "Reviewed-by: Wen Congyang <wency@cn.fujitsu.com>\n"
+ "Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>\n"
+ "Tested-by: Lin Feng <linfeng@cn.fujitsu.com>\n"
+ "---\n"
+ " mm/page_alloc.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-\n"
+ " 1 file changed, 65 insertions(+), 1 deletion(-)\n"
+ "\n"
+ "diff --git a/mm/page_alloc.c b/mm/page_alloc.c\n"
+ "index e35ee27..41c3b51 100644\n"
+ "--- a/mm/page_alloc.c\n"
+ "+++ b/mm/page_alloc.c\n"
+ "@@ -4338,6 +4338,60 @@ static unsigned long __meminit zone_absent_pages_in_node(int nid,\n"
+ " \treturn __absent_pages_in_range(nid, zone_start_pfn, zone_end_pfn);\n"
+ " }\n"
+ " \n"
+ "+/**\n"
+ "+ * Try to figure out zone_movable_pfn[] from movablecore_map.\n"
+ "+ */\n"
+ "+static int __init find_zone_movable_from_movablecore_map(void)\n"
+ "+{\n"
+ "+\tint map_pos = 0, i, nid;\n"
+ "+\tunsigned long start_pfn, end_pfn;\n"
+ "+\n"
+ "+\tif (!movablecore_map.nr_map)\n"
+ "+\t\treturn 0;\n"
+ "+\n"
+ "+\t/* Iterate all ranges from minimum to maximum */\n"
+ "+\tfor_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {\n"
+ "+\t\t/*\n"
+ "+\t\t * If we have found lowest pfn of ZONE_MOVABLE of the node\n"
+ "+\t\t * specified by user, just go on to check next range.\n"
+ "+\t\t */\n"
+ "+\t\tif (zone_movable_pfn[nid])\n"
+ "+\t\t\tcontinue;\n"
+ "+\n"
+ "+#ifdef CONFIG_HIGHMEM\n"
+ "+\t\t/* Skip lowmem if ZONE_MOVABLE is highmem */\n"
+ "+\t\tif (zone_movable_is_highmem() &&\n"
+ "+\t\t    start_pfn < arch_zone_lowest_possible_pfn[ZONE_HIGHMEM])\n"
+ "+\t\t\tstart_pfn = arch_zone_lowest_possible_pfn[ZONE_HIGHMEM];\n"
+ "+\t\tif (start_pfn > end_pfn)\n"
+ "+\t\t\tcontinue;\n"
+ "+#endif\n"
+ "+\n"
+ "+\t\twhile (map_pos < movablecore_map.nr_map) {\n"
+ "+\t\t\tif (end_pfn < movablecore_map.map[map_pos].start)\n"
+ "+\t\t\t\tbreak;\n"
+ "+\n"
+ "+\t\t\tif (start_pfn > movablecore_map.map[map_pos].end) {\n"
+ "+\t\t\t\tmap_pos++;\n"
+ "+\t\t\t\tcontinue;\n"
+ "+\t\t\t}\n"
+ "+\n"
+ "+\t\t\t/*\n"
+ "+\t\t\t * The start_pfn of ZONE_MOVABLE is either the minimum\n"
+ "+\t\t\t * pfn specified by movablecore_map, or 0, which means\n"
+ "+\t\t\t * the node has no ZONE_MOVABLE.\n"
+ "+\t\t\t */\n"
+ "+\t\t\tstart_pfn = max(start_pfn,\n"
+ "+\t\t\t\t\tmovablecore_map.map[map_pos].start);\n"
+ "+\t\t\tzone_movable_pfn[nid] = roundup(zone_movable_pfn[nid],\n"
+ "+\t\t\t\t\t\t\tMAX_ORDER_NR_PAGES);\n"
+ "+\t\t\tbreak;\n"
+ "+\t\t}\n"
+ "+\t}\n"
+ "+\n"
+ "+\treturn 1;\n"
+ "+}\n"
+ "+\n"
+ " #else /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */\n"
+ " static inline unsigned long __meminit zone_spanned_pages_in_node(int nid,\n"
+ " \t\t\t\t\tunsigned long zone_type,\n"
+ "@@ -4356,6 +4410,11 @@ static inline unsigned long __meminit zone_absent_pages_in_node(int nid,\n"
+ " \treturn zholes_size[zone_type];\n"
+ " }\n"
+ " \n"
+ "+static int __init find_zone_movable_from_movablecore_map(void)\n"
+ "+{\n"
+ "+\treturn 0;\n"
+ "+}\n"
+ "+\n"
+ " #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */\n"
+ " \n"
+ " static void __meminit calculate_node_totalpages(struct pglist_data *pgdat,\n"
+ "@@ -4739,6 +4798,12 @@ static void __init find_zone_movable_pfns_for_nodes(void)\n"
+ " \tunsigned long totalpages = early_calculate_totalpages();\n"
+ " \tint usable_nodes = nodes_weight(node_states[N_HIGH_MEMORY]);\n"
+ " \n"
+ "+\tfind_usable_zone_for_movable();\n"
+ "+\n"
+ "+\t/* movablecore_map takes precedence over movablecore/kernelcore */\n"
+ "+\tif (find_zone_movable_from_movablecore_map())\n"
+ "+\t\treturn;\n"
+ "+\n"
+ " \t/*\n"
+ " \t * If movablecore was specified, calculate what size of\n"
+ " \t * kernelcore that corresponds so that memory usable for\n"
+ "@@ -4766,7 +4831,6 @@ static void __init find_zone_movable_pfns_for_nodes(void)\n"
+ " \t\tgoto out;\n"
+ " \n"
+ " \t/* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */\n"
+ "-\tfind_usable_zone_for_movable();\n"
+ " \tusable_startpfn = arch_zone_lowest_possible_pfn[movable_zone];\n"
+ " \n"
+ " restart:\n"
+ "-- \n"
+ 1.7.9.5
 
-719ef8b5a119f8496df227177f604314a418fa4c4db4d3cdaec3a4fa3ed7e65e
+40f38031a922cc6669f781470fa7e80acb49840206310fd2cf0c458c04fd6aba

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.