Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79860
b: refs/heads/master
c: b263295
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Ingo Molnar committed Jan 30, 2008
1 parent 2e4ca27 commit 8690da4
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 160 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ebd1290ba12121d66285cc06987ca97bcdfc55b
refs/heads/master: b263295dbffd33b0fbff670720fa178c30e3392a
22 changes: 9 additions & 13 deletions trunk/arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -891,25 +891,29 @@ config HAVE_ARCH_ALLOC_REMAP

config ARCH_FLATMEM_ENABLE
def_bool y
depends on (X86_32 && ARCH_SELECT_MEMORY_MODEL && X86_PC) || (X86_64 && !NUMA)
depends on X86_32 && ARCH_SELECT_MEMORY_MODEL && X86_PC

config ARCH_DISCONTIGMEM_ENABLE
def_bool y
depends on NUMA
depends on NUMA && X86_32

config ARCH_DISCONTIGMEM_DEFAULT
def_bool y
depends on NUMA
depends on NUMA && X86_32

config ARCH_SPARSEMEM_DEFAULT
def_bool y
depends on X86_64

config ARCH_SPARSEMEM_ENABLE
def_bool y
depends on NUMA || (EXPERIMENTAL && (X86_PC || X86_64))
depends on X86_64 || NUMA || (EXPERIMENTAL && X86_PC)
select SPARSEMEM_STATIC if X86_32
select SPARSEMEM_VMEMMAP_ENABLE if X86_64

config ARCH_SELECT_MEMORY_MODEL
def_bool y
depends on X86_32 && ARCH_SPARSEMEM_ENABLE
depends on ARCH_SPARSEMEM_ENABLE

config ARCH_MEMORY_PROBE
def_bool X86_64
Expand Down Expand Up @@ -1207,18 +1211,10 @@ config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y
depends on X86_64 || (X86_32 && HIGHMEM)

config MEMORY_HOTPLUG_RESERVE
def_bool X86_64
depends on (MEMORY_HOTPLUG && DISCONTIGMEM)

config HAVE_ARCH_EARLY_PFN_TO_NID
def_bool X86_64
depends on NUMA

config OUT_OF_LINE_PFN_TO_PAGE
def_bool X86_64
depends on DISCONTIGMEM

menu "Power management options"
depends on !X86_VOYAGER

Expand Down
9 changes: 0 additions & 9 deletions trunk/arch/x86/configs/x86_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,6 @@ CONFIG_K8_NUMA=y
CONFIG_NODES_SHIFT=6
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NUMA_EMU=y
CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
CONFIG_DISCONTIGMEM_MANUAL=y
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_DISCONTIGMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_NEED_MULTIPLE_NODES=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/x86/kernel/machine_kexec_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,5 @@ NORET_TYPE void machine_kexec(struct kimage *image)
void arch_crash_save_vmcoreinfo(void)
{
VMCOREINFO_SYMBOL(init_level4_pgt);

#ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE
VMCOREINFO_SYMBOL(node_data);
VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
#endif
}

28 changes: 0 additions & 28 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,34 +486,6 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);

#endif /* CONFIG_MEMORY_HOTPLUG */

#ifdef CONFIG_MEMORY_HOTPLUG_RESERVE
/*
* Memory Hotadd without sparsemem. The mem_maps have been allocated in advance,
* just online the pages.
*/
int __add_pages(struct zone *z, unsigned long start_pfn, unsigned long nr_pages)
{
int err = -EIO;
unsigned long pfn;
unsigned long total = 0, mem = 0;
for (pfn = start_pfn; pfn < start_pfn + nr_pages; pfn++) {
if (pfn_valid(pfn)) {
online_page(pfn_to_page(pfn));
err = 0;
mem++;
}
total++;
}
if (!err) {
z->spanned_pages += total;
z->present_pages += mem;
z->zone_pgdat->node_spanned_pages += total;
z->zone_pgdat->node_present_pages += mem;
}
return err;
}
#endif

static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, kcore_modules,
kcore_vsyscall;

Expand Down
17 changes: 0 additions & 17 deletions trunk/arch/x86/mm/ioremap_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,6 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
return (__force void __iomem *)phys_to_virt(phys_addr);

#ifdef CONFIG_FLATMEM
/*
* Don't allow anybody to remap normal RAM that we're using..
*/
if (last_addr < virt_to_phys(high_memory)) {
char *t_addr, *t_end;
struct page *page;

t_addr = __va(phys_addr);
t_end = t_addr + (size - 1);

for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++)
if(!PageReserved(page))
return NULL;
}
#endif

pgprot = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_GLOBAL
| _PAGE_DIRTY | _PAGE_ACCESSED | flags);
/*
Expand Down
21 changes: 0 additions & 21 deletions trunk/arch/x86/mm/numa_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,10 @@ int __init compute_hash_shift(struct bootnode *nodes, int numnodes)
return shift;
}

#ifdef CONFIG_SPARSEMEM
int early_pfn_to_nid(unsigned long pfn)
{
return phys_to_nid(pfn << PAGE_SHIFT);
}
#endif

static void * __init early_node_mem(int nodeid, unsigned long start,
unsigned long end, unsigned long size)
Expand Down Expand Up @@ -635,23 +633,4 @@ void __init init_cpu_to_node(void)
}
}

#ifdef CONFIG_DISCONTIGMEM
/*
* Functions to convert PFNs from/to per node page addresses.
* These are out of line because they are quite big.
* They could be all tuned by pre caching more state.
* Should do that.
*/

int pfn_valid(unsigned long pfn)
{
unsigned nid;
if (pfn >= num_physpages)
return 0;
nid = pfn_to_nid(pfn);
if (nid == 0xff)
return 0;
return pfn >= node_start_pfn(nid) && (pfn) < node_end_pfn(nid);
}
EXPORT_SYMBOL(pfn_valid);
#endif
57 changes: 0 additions & 57 deletions trunk/arch/x86/mm/srat_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,70 +151,13 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
pxm, pa->apic_id, node);
}

#ifdef CONFIG_MEMORY_HOTPLUG_RESERVE
/*
* Protect against too large hotadd areas that would fill up memory.
*/
static int hotadd_enough_memory(struct bootnode *nd)
{
static unsigned long allocated;
static unsigned long last_area_end;
unsigned long pages = (nd->end - nd->start) >> PAGE_SHIFT;
long mem = pages * sizeof(struct page);
unsigned long addr;
unsigned long allowed;
unsigned long oldpages = pages;

if (mem < 0)
return 0;
allowed = (end_pfn - absent_pages_in_range(0, end_pfn)) * PAGE_SIZE;
allowed = (allowed / 100) * hotadd_percent;
if (allocated + mem > allowed) {
unsigned long range;
/* Give them at least part of their hotadd memory upto hotadd_percent
It would be better to spread the limit out
over multiple hotplug areas, but that is too complicated
right now */
if (allocated >= allowed)
return 0;
range = allowed - allocated;
pages = (range / PAGE_SIZE);
mem = pages * sizeof(struct page);
nd->end = nd->start + range;
}
/* Not completely fool proof, but a good sanity check */
addr = find_e820_area(last_area_end, end_pfn<<PAGE_SHIFT, mem);
if (addr == -1UL)
return 0;
if (pages != oldpages)
printk(KERN_NOTICE "SRAT: Hotadd area limited to %lu bytes\n",
pages << PAGE_SHIFT);
last_area_end = addr + mem;
allocated += mem;
return 1;
}

static int update_end_of_memory(unsigned long end)
{
found_add_area = 1;
if ((end >> PAGE_SHIFT) > end_pfn)
end_pfn = end >> PAGE_SHIFT;
return 1;
}

static inline int save_add_info(void)
{
return hotadd_percent > 0;
}
#else
int update_end_of_memory(unsigned long end) {return -1;}
static int hotadd_enough_memory(struct bootnode *nd) {return 1;}
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
static inline int save_add_info(void) {return 1;}
#else
static inline int save_add_info(void) {return 0;}
#endif
#endif
/*
* Update nodes_add and decide if to include add are in the zone.
* Both SPARSE and RESERVE need nodes_add infomation.
Expand Down
6 changes: 0 additions & 6 deletions trunk/include/asm-x86/mmzone_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)

extern int early_pfn_to_nid(unsigned long pfn);

#ifdef CONFIG_DISCONTIGMEM
#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)

extern int pfn_valid(unsigned long pfn);
#endif

#ifdef CONFIG_NUMA_EMU
#define FAKE_NODE_MIN_SIZE (64*1024*1024)
#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1uL))
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/asm-x86/page_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ extern unsigned long __phys_addr(unsigned long);
#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
#define __boot_va(x) __va(x)
#define __boot_pa(x) __pa(x)
#ifdef CONFIG_FLATMEM
#define pfn_valid(pfn) ((pfn) < end_pfn)
#endif

#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
Expand Down

0 comments on commit 8690da4

Please sign in to comment.