RFC [PATCH] x86: try to remove arch_get_ram_range
Subsystems (6)
want to remove arch_get_ram_range, and use early_node_map instead.
arch/x86/mm/init_32.c +4 -2
@@ -298,7 +298,7 @@ struct add_highpages_data {unsigned long end_pfn; }; -static void __init add_highpages_work_fn (unsigned long start_pfn, +static int __init add_highpages_work_fn (unsigned long start_pfn,unsigned long end_pfn,void *datax) {int node_pfn;
@@ -311,7 +311,7 @@ static void __init add_highpages_work_fn final_start_pfn =max (start_pfn, data->start_pfn); final_end_pfn =min (end_pfn, data->end_pfn);if (final_start_pfn >= final_end_pfn) -return ; +return 0 ;for (node_pfn = final_start_pfn; node_pfn < final_end_pfn; node_pfn++) {
@@ -321,6 +321,8 @@ static void __init add_highpages_work_fnadd_one_highpage_init (page, node_pfn); } +return 0 ; + } void __init add_highpages_with_active_regions(int nid, unsigned long start_pfn,
drivers/pci/intel-iommu.c +37 -14
66 lines not on this page · raw message
include/linux/mm.h +1 -1
@@ -1011,7 +1011,7 @@ extern unsigned long find_min_pfn_with_aextern unsigned long find_max_pfn_with_active_regions (void );extern void free_bootmem_with_active_regions (int nid,unsigned long max_low_pfn); -typedef void (*work_fn_t )(unsigned long ,unsigned long ,void *); +typedef int (*work_fn_t )(unsigned long ,unsigned long ,void *);extern void work_with_active_regions (int nid,work_fn_t work_fn,void *data);extern void sparse_memory_present_with_active_regions (int nid);#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
mm/page_alloc.c +7 -3
@@ -2942,10 +2942,14 @@ void __init free_bootmem_with_active_regvoid __init work_with_active_regions (int nid,work_fn_t work_fn,void *data) {int i; +int ret; -for_each_active_range_index_in_nid (i, nid) -work_fn (early_node_map[i].start_pfn, early_node_map[i].end_pfn, - data); +for_each_active_range_index_in_nid (i, nid) { + ret =work_fn (early_node_map[i].start_pfn, + early_node_map[i].end_pfn, data); +if (ret) +break ; + } }/** * sparse_memory_present_with_active_regions - Call memory_present for each active range
Quoted 1 line · Yinghai Lu
want to remove
arch_get_ram_range, and useearly_node_mapinstead.
(small request: please include diffstat output in your patches in the future if possible: "quilt refresh --diffstat" will do that - this way people will know why they were Cc:-ed)
this touches the MM:
arch/x86/mm/init_32.c | 6 +++-- drivers/pci/intel-iommu.c | 51 +++++++++++++++++++++++++++++++++------------- include/linux/mm.h | 2 - mm/page_alloc.c | 10 ++++++--- 4 files changed, 49 insertions(+), 20 deletions(-)
but has many dependencies on ongoing arch/x86 work. Andrew, is this change fine with with you?
Ingo
Andrew Morton
maintainerQuoted 11 lines · On Wed, 18 Jun 2008 16:07:26 +0200 Ingo Molnar <[email protected]> wrote:
Quoted 1 line · Yinghai Lu
want to remove
arch_get_ram_range, and useearly_node_mapinstead.(small request: please include diffstat output in your patches in the future if possible: "quilt refresh --diffstat" will do that - this way people will know why they were Cc:-ed)
this touches the MM:
Quoted 9 lines
arch/x86/mm/init_32.c | 6 +++-- drivers/pci/intel-iommu.c | 51 +++++++++++++++++++++++++++++++++------------- include/linux/mm.h | 2 - mm/page_alloc.c | 10 ++++++--- 4 files changed, 49 insertions(+), 20 deletions(-)but has many dependencies on ongoing
arch/x86work. Andrew, is this change fine with with you?
Beats me - I don't even have a mm/page_alloc.c:work_with_active_regions() in my tree.
Quoted 19 lines · Andrew Morton
Quoted 17 lines · On Wed, 18 Jun 2008 16:07:26 +0200 Ingo Molnar <[email protected]> wrote:
Quoted 1 line · Yinghai Lu
want to remove
arch_get_ram_range, and useearly_node_mapinstead.(small request: please include diffstat output in your patches in the future if possible: "quilt refresh --diffstat" will do that - this way people will know why they were Cc:-ed)
this touches the MM:
arch/x86/mm/init_32.c | 6 +++-- drivers/pci/intel-iommu.c | 51 +++++++++++++++++++++++++++++++++------------- include/linux/mm.h | 2 - mm/page_alloc.c | 10 ++++++--- 4 files changed, 49 insertions(+), 20 deletions(-)
Quoted 7 lines
Quoted 3 lines
but has many dependencies on ongoing
arch/x86work. Andrew, is this change fine with with you?Beats me - I don't even have a mm/page_alloc.c:work_with_active_regions() in my tree.
i cut and paste from tip...
commit a6b01b5fe51a99ecc0844a9e646819941227fd25
Author: Yinghai Lu <[email protected]> Date: Mon Jun 16 20:10:55 2008 -0700
RFC x86: try to remove arch_get_ram_range
want to remove arch_get_ram_range, and use early_node_map instead.
mm/page_alloc.c +7 -3
@@ -2933,10 +2933,14 @@ void __init free_bootmem_with_active_regions(int nid,void __init work_with_active_regions (int nid,work_fn_t work_fn,void *data) {int i; +int ret; -for_each_active_range_index_in_nid (i, nid) -work_fn (early_node_map[i].start_pfn, early_node_map[i].end_pfn, - data); +for_each_active_range_index_in_nid (i, nid) { + ret =work_fn (early_node_map[i].start_pfn, + early_node_map[i].end_pfn, data); +if (ret) +break ; + } }/** * sparse_memory_present_with_active_regions - Call memory_present
for each active range
commit e827df2898d988698e5b829009255579638a0110
Author: Yinghai Lu <[email protected]> Date: Sat Jun 14 18:32:52 2008 -0700
x86, mm: use add_highpages_with_active_regions() for high pages init v2
use early_node_map to init high pages, so we can remove page_is_ram() and page_is_reserved_early() in the big loop with add_one_highpage
also remove page_is_reserved_early(), it is not needed anymore.
v2: fix the build of other platforms
mm/page_alloc.c +8 -0
@@ -2955,6 +2955,14 @@ void __init free_bootmem_with_active_regions(int nid, } } +void __init work_with_active_regions (int nid,work_fn_t work_fn,void *data) +{ +int i; + +for_each_active_range_index_in_nid (i, nid) +work_fn (early_node_map[i].start_pfn, early_node_map[i].end_pfn, + data); +}/** * sparse_memory_present_with_active_regions - Call memory_present
for each active range
* @nid: The node to call memory_present for. If MAX_NUMNODES, all
nodes will be used.