Commit 31d71284 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: DISCONTIGMEM updates

parent 657732b7
......@@ -99,23 +99,26 @@ mmu_gather_t mmu_gathers[NR_CPUS];
void show_mem(void)
{
int pfn, total = 0, reserved = 0;
int total = 0, reserved = 0;
int shared = 0, cached = 0;
struct page *page;
pg_data_t *pgdat;
unsigned long i;
printk("Mem-info:\n");
show_free_areas();
printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
pfn = max_mapnr;
while (pfn-- > 0) {
page = pfn_to_page(pfn);
total++;
if (PageReserved(page))
reserved++;
else if (PageSwapCache(page))
cached++;
else if (page_count(page))
shared += page_count(page) - 1;
for_each_pgdat(pgdat) {
for (i = 0; i < pgdat->node_size; i++) {
page = pgdat->node_mem_map + i;
total++;
if (PageReserved(page))
reserved++;
else if (PageSwapCache(page))
cached++;
else if (page_count(page))
shared += page_count(page) - 1;
}
}
printk("%d pages of RAM\n",total);
printk("%d reserved pages\n",reserved);
......@@ -511,9 +514,8 @@ void __init mem_init(void)
int datapages = 0;
int initpages = 0;
max_mapnr = max_low_pfn;
num_physpages = max_low_pfn; /* RAM is assumed contiguous */
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
num_physpages = max_mapnr; /* RAM is assumed contiguous */
max_pfn = max_low_pfn;
#ifdef CONFIG_DISCONTIGMEM
......@@ -535,6 +537,8 @@ void __init mem_init(void)
PAGE_OFFSET, (unsigned long)__va(lmb_end_of_DRAM()));
}
#else
max_mapnr = num_physpages;
totalram_pages += free_all_bootmem();
if ( sysmap_size )
......
......@@ -8,6 +8,7 @@
#define _ASM_MMZONE_H_
#include <linux/config.h>
#include <asm/smp.h>
#ifdef CONFIG_DISCONTIGMEM
......@@ -21,7 +22,6 @@ extern int numa_node_exists[];
extern int numa_cpu_lookup_table[];
extern int numa_memory_lookup_table[];
#define MAX_NUMNODES 16
#define MAX_MEMORY (1UL << 41)
/* 256MB regions */
#define MEMORY_INCREMENT_SHIFT 28
......@@ -112,5 +112,8 @@ static inline int __cpu_to_node(int cpu)
page_zone(__tmp)->zone_start_pfn); \
})
/* XXX fix for discontiguous physical memory */
#define discontigmem_pfn_valid(pfn) ((pfn) < num_physpages)
#endif /* CONFIG_DISCONTIGMEM */
#endif /* _ASM_MMZONE_H_ */
#ifndef _ASM_MAX_NUMNODES_H
#define _ASM_MAX_NUMNODES_H
#define MAX_NUMNODES 16
#endif /* _ASM_MAX_NUMNODES_H */
......@@ -207,13 +207,15 @@ static inline int get_order(unsigned long size)
#ifdef CONFIG_DISCONTIGMEM
#define page_to_pfn(page) discontigmem_page_to_pfn(page)
#define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn)
#define pfn_valid(pfn) discontigmem_pfn_valid(pfn)
#else
#define pfn_to_page(pfn) (mem_map + (pfn))
#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#endif
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
......
......@@ -35,12 +35,7 @@
#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
#if 0
/* DRENG / PPPBBB This is a compiler bug!!! */
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
#else
#define USER_PTRS_PER_PGD (1024)
#endif
#define USER_PTRS_PER_PGD (TASK_SIZE_USER64 / PGDIR_SIZE)
#define FIRST_USER_PGD_NR 0
#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
......
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