Commit 73027d99 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove valid_addr_bitmap

From: William Lee Irwin III <wli@holomorphy.com>

->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.
parent f70ceb5a
...@@ -72,9 +72,8 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n) ...@@ -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 \ ((unsigned long)__va(NODE_DATA(kvaddr_to_nid(kaddr))->node_start_pfn \
<< PAGE_SHIFT)) << PAGE_SHIFT))
#define kern_addr_valid(kaddr) \ /* XXX: FIXME -- wli */
test_bit(local_mapnr(kaddr), \ #define kern_addr_valid(kaddr) (0)
NODE_DATA(kvaddr_to_nid(kaddr))->valid_addr_bitmap)
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
......
...@@ -62,12 +62,8 @@ extern struct pglist_data *node_data[]; ...@@ -62,12 +62,8 @@ extern struct pglist_data *node_data[];
(__pfn - node_start_pfn(pfn_to_nid(__pfn))); \ (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \
}) })
#define kern_addr_valid(kaddr) \ /* XXX: FIXME -- wli */
({ \ #define kern_addr_valid(kaddr) (0)
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); \
})
#define pfn_to_page(pfn) \ #define pfn_to_page(pfn) \
({ \ ({ \
......
...@@ -75,9 +75,8 @@ extern plat_pg_data_t *plat_node_data[]; ...@@ -75,9 +75,8 @@ extern plat_pg_data_t *plat_node_data[];
(((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \ (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \
sizeof(struct page)))) sizeof(struct page))))
#define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) > \ /* XXX: FIXME -- wli */
-1) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \ #define kern_addr_valid(addr) (0)
NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap)))
#define pfn_to_page(pfn) (mem_map + (pfn)) #define pfn_to_page(pfn) (mem_map + (pfn))
#define page_to_pfn(page) \ #define page_to_pfn(page) \
......
...@@ -72,11 +72,8 @@ static inline int pa_to_nid(unsigned long pa) ...@@ -72,11 +72,8 @@ static inline int pa_to_nid(unsigned long pa)
#define local_mapnr(kvaddr) \ #define local_mapnr(kvaddr) \
( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr))
#if 0 /* XXX fix - Anton - and wli */
/* XXX fix - Anton */ #define kern_addr_valid(kaddr) (0)
#define kern_addr_valid(kaddr) test_bit(local_mapnr(kaddr), \
NODE_DATA(kvaddr_to_nid(kaddr))->valid_addr_bitmap)
#endif
/* Written this way to avoid evaluating arguments twice */ /* Written this way to avoid evaluating arguments twice */
#define discontigmem_pfn_to_page(pfn) \ #define discontigmem_pfn_to_page(pfn) \
......
...@@ -205,7 +205,6 @@ typedef struct pglist_data { ...@@ -205,7 +205,6 @@ typedef struct pglist_data {
struct zonelist node_zonelists[MAX_NR_ZONES]; struct zonelist node_zonelists[MAX_NR_ZONES];
int nr_zones; int nr_zones;
struct page *node_mem_map; struct page *node_mem_map;
unsigned long *valid_addr_bitmap;
struct bootmem_data *bdata; struct bootmem_data *bdata;
unsigned long node_start_pfn; unsigned long node_start_pfn;
unsigned long node_present_pages; /* total number of physical pages */ unsigned long node_present_pages; /* total number of physical pages */
......
...@@ -1182,24 +1182,6 @@ static void __init calculate_zone_totalpages(struct pglist_data *pgdat, ...@@ -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); 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 * 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, ...@@ -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); free_area_init_core(pgdat, zones_size, zholes_size);
memblk_set_online(node_to_memblk(nid)); memblk_set_online(node_to_memblk(nid));
calculate_zone_bitmap(pgdat, zones_size);
} }
#ifndef CONFIG_DISCONTIGMEM #ifndef CONFIG_DISCONTIGMEM
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment