From 73027d993d79480b7117c2a7e59c81629d10b0cf Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 3 Feb 2004 18:43:18 -0800 Subject: [PATCH] [PATCH] remove valid_addr_bitmap From: William Lee Irwin III ->valid_addr_bitmap is initialized nowhere. Any kern_addr_valid() testing it returns 0 unconditionally. This patch converts kern_addr_valid() implementations using it to return 0 as per the above and removes it from structures and zone initialization. Untested (not even compiletested), though a similar patch also nuking d_validate() was in use in -wli for several months. --- include/asm-alpha/mmzone.h | 5 ++--- include/asm-i386/mmzone.h | 8 ++------ include/asm-mips/mmzone.h | 5 ++--- include/asm-ppc64/mmzone.h | 7 ++----- include/linux/mmzone.h | 1 - mm/page_alloc.c | 20 -------------------- 6 files changed, 8 insertions(+), 38 deletions(-) diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h index 36e3130c66967..ce75633b5052d 100644 --- a/include/asm-alpha/mmzone.h +++ b/include/asm-alpha/mmzone.h @@ -72,9 +72,8 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n) ((unsigned long)__va(NODE_DATA(kvaddr_to_nid(kaddr))->node_start_pfn \ << PAGE_SHIFT)) -#define kern_addr_valid(kaddr) \ - test_bit(local_mapnr(kaddr), \ - NODE_DATA(kvaddr_to_nid(kaddr))->valid_addr_bitmap) +/* XXX: FIXME -- wli */ +#define kern_addr_valid(kaddr) (0) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 8587d7e3a2ae5..1bd79dfb3c9a4 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h @@ -62,12 +62,8 @@ extern struct pglist_data *node_data[]; (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \ }) -#define kern_addr_valid(kaddr) \ -({ \ - unsigned long __kaddr = (unsigned long)(kaddr); \ - pg_data_t *__pgdat = NODE_DATA(kvaddr_to_nid(__kaddr)); \ - test_bit(local_mapnr(__kaddr), __pgdat->valid_addr_bitmap); \ -}) +/* XXX: FIXME -- wli */ +#define kern_addr_valid(kaddr) (0) #define pfn_to_page(pfn) \ ({ \ diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h index cba337b07be19..69cb153bb2542 100644 --- a/include/asm-mips/mmzone.h +++ b/include/asm-mips/mmzone.h @@ -75,9 +75,8 @@ extern plat_pg_data_t *plat_node_data[]; (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \ sizeof(struct page)))) -#define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) > \ - -1) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \ - NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap))) +/* XXX: FIXME -- wli */ +#define kern_addr_valid(addr) (0) #define pfn_to_page(pfn) (mem_map + (pfn)) #define page_to_pfn(page) \ diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h index 7a305c6826937..7503c373f55eb 100644 --- a/include/asm-ppc64/mmzone.h +++ b/include/asm-ppc64/mmzone.h @@ -72,11 +72,8 @@ static inline int pa_to_nid(unsigned long pa) #define local_mapnr(kvaddr) \ ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) -#if 0 -/* XXX fix - Anton */ -#define kern_addr_valid(kaddr) test_bit(local_mapnr(kaddr), \ - NODE_DATA(kvaddr_to_nid(kaddr))->valid_addr_bitmap) -#endif +/* XXX fix - Anton - and wli */ +#define kern_addr_valid(kaddr) (0) /* Written this way to avoid evaluating arguments twice */ #define discontigmem_pfn_to_page(pfn) \ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 66cbaa36d8781..71f2f39cae0f1 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -205,7 +205,6 @@ typedef struct pglist_data { struct zonelist node_zonelists[MAX_NR_ZONES]; int nr_zones; struct page *node_mem_map; - unsigned long *valid_addr_bitmap; struct bootmem_data *bdata; unsigned long node_start_pfn; unsigned long node_present_pages; /* total number of physical pages */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 21cdc12dff7f7..0a6832b028b54 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1182,24 +1182,6 @@ static void __init calculate_zone_totalpages(struct pglist_data *pgdat, printk("On node %d totalpages: %lu\n", pgdat->node_id, realtotalpages); } -/* - * Get space for the valid bitmap. - */ -static void __init calculate_zone_bitmap(struct pglist_data *pgdat, - unsigned long *zones_size) -{ - unsigned long size = 0; - int i; - - for (i = 0; i < MAX_NR_ZONES; i++) - size += zones_size[i]; - size = LONG_ALIGN((size + 7) >> 3); - if (size) { - pgdat->valid_addr_bitmap = - (unsigned long *)alloc_bootmem_node(pgdat, size); - memset(pgdat->valid_addr_bitmap, 0, size); - } -} /* * Initially all pages are reserved - free ones are freed @@ -1393,8 +1375,6 @@ void __init free_area_init_node(int nid, struct pglist_data *pgdat, free_area_init_core(pgdat, zones_size, zholes_size); memblk_set_online(node_to_memblk(nid)); - - calculate_zone_bitmap(pgdat, zones_size); } #ifndef CONFIG_DISCONTIGMEM -- 2.53.0