diff options
author | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-02-10 09:07:31 +0000 |
---|---|---|
committer | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-02-10 09:07:31 +0000 |
commit | c566573a9a2049a15f9e13375e7c1bf29fe84d0a (patch) | |
tree | fae60e5f2bc2184007dd77b27589f4891eef6b9d | |
parent | ccd309e0011c2343f720b04f2b3fa2b1c2b3e530 (diff) |
The pernode pgdat structure is now allocated out of the corresponding
node's memory, instead of having all the per node data in an array on
node 0.
-rw-r--r-- | arch/mips64/sgi-ip27/ip27-memory.c | 17 | ||||
-rw-r--r-- | include/asm-mips64/mmzone.h | 4 |
2 files changed, 14 insertions, 7 deletions
diff --git a/arch/mips64/sgi-ip27/ip27-memory.c b/arch/mips64/sgi-ip27/ip27-memory.c index cbbea5709..6e547920b 100644 --- a/arch/mips64/sgi-ip27/ip27-memory.c +++ b/arch/mips64/sgi-ip27/ip27-memory.c @@ -33,7 +33,6 @@ typedef unsigned long pfn_t; /* into <asm/sn/types.h> */ extern char _end; #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) -#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) #define SLOT_IGNORED 0xffff short slot_lastfilled_cache[MAX_COMPACT_NODES]; @@ -41,7 +40,7 @@ unsigned short slot_psize_cache[MAX_COMPACT_NODES][MAX_MEM_SLOTS]; static pfn_t numpages; static pfn_t pagenr = 0; -plat_pg_data_t plat_node_data[MAX_COMPACT_NODES]; +plat_pg_data_t *plat_node_data[MAX_COMPACT_NODES]; bootmem_data_t plat_node_bdata[MAX_COMPACT_NODES]; int numa_debug(void) @@ -66,8 +65,8 @@ pfn_t node_getfirstfree(cnodeid_t cnode) return KDM_TO_PHYS(SYMMON_STK_ADDR(nasid, 0)); #endif if (cnode == 0) - return (KDM_TO_PHYS(PFN_ALIGN(&_end) - (CKSEG0 - K0BASE)) - >> PAGE_SHIFT); + return (KDM_TO_PHYS(PAGE_ALIGN((unsigned long)(&_end)) - + (CKSEG0 - K0BASE)) >> PAGE_SHIFT); return slot_getbasepfn(cnode, 0); } @@ -223,11 +222,12 @@ void __init prom_meminit(void) cnodeid_t node; pfn_t slot_firstpfn, slot_lastpfn, slot_freepfn; unsigned long bootmap_size; + int node_datasz; + node_datasz = PFN_UP(sizeof(plat_pg_data_t)); mlreset(); numpages = szmem(0, 0); for (node = (numnodes - 1); node >= 0; node--) { - NODE_DATA(node)->bdata = plat_node_bdata + node; slot_firstpfn = slot_getbasepfn(node, 0); slot_lastpfn = slot_firstpfn + slot_getsize(node, 0); slot_freepfn = node_getfirstfree(node); @@ -236,6 +236,13 @@ void __init prom_meminit(void) max_low_pfn = (slot_lastpfn - slot_firstpfn); if (node != 0) setup_test(node, slot_freepfn, slot_lastpfn); + /* + * Allocate the node data structure on the node first. + */ + plat_node_data[node] = (plat_pg_data_t *)(__va(slot_freepfn \ + << PAGE_SHIFT)); + NODE_DATA(node)->bdata = plat_node_bdata + node; + slot_freepfn += node_datasz; bootmap_size = init_bootmem_node(node, slot_freepfn, slot_firstpfn, slot_lastpfn); free_bootmem_node(node, slot_firstpfn << PAGE_SHIFT, diff --git a/include/asm-mips64/mmzone.h b/include/asm-mips64/mmzone.h index 9df5dc0b5..2d5d1a9b3 100644 --- a/include/asm-mips64/mmzone.h +++ b/include/asm-mips64/mmzone.h @@ -20,10 +20,10 @@ typedef struct plat_pglist_data { */ extern int numa_debug(void); -extern plat_pg_data_t plat_node_data[]; +extern plat_pg_data_t *plat_node_data[]; #define PHYSADDR_TO_NID(pa) NASID_TO_COMPACT_NODEID(NASID_GET(pa)) -#define PLAT_NODE_DATA(n) (plat_node_data + (n)) +#define PLAT_NODE_DATA(n) (plat_node_data[n]) #define PLAT_NODE_DATA_STARTNR(n) (PLAT_NODE_DATA(n)->start_mapnr) #define PLAT_NODE_DATA_LOCALNR(p, n) \ (((p) - PLAT_NODE_DATA(n)->physstart) >> PAGE_SHIFT) |