x86/mm for v2.6.31
Subsystems (6)
Linus,
Please pull the latest x86-mm-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-mm-for-linus
The mm.h and page_alloc.c change was OK-ed by Andrew.
out-of-topic modifications in x86-mm-for-linus:
-----------------------------------------------include/linux/mm.h # 888a589: mm, x86: remove MEMORY_HOTPLUG_REmm/page_alloc.c # 888a589: mm, x86: remove MEMORY_HOTPLUG_RE
Thanks,
Ingo
------------------>
Amerigo Wang (2):
x86: merge process.c a bit
x86: process.c, remove useless headers
H. Peter Anvin (1):
x86: fix typo in address space documentation
Ingo Molnar (2):
x86/mm: further cleanups of fault.c's include file section x86, mm: fault.c, use printk_once() in is_errata93()
Jaswinder Singh Rajput (1):
x86: page_types.h unification of declarations
Linus Torvalds (1):
x86, e820, pci: reserve extra free space near end of RAM
Pekka Enberg (5):
x86: unify noexec handling
x86: move max_pfn_mapped and max_low_pfn_mapped to setup.c
x86: move per-cpu mmu_gathers to mm/init.c
x86: unify 64-bit UMA and NUMA paging_init()
x86: use sparse_memory_present_with_active_regions() on UMA
Rik van Riel (1):
x86: 46 bit physical address support on 64 bits
Shaohua Li (1):
x86: make sparse mem work in non-NUMA mode
Yinghai Lu (8):
x86: remove (null) in /sys kernel_page_tables
x86/pci: remove rounding quirk from e820_setup_gap()
x86: clean up and and print out initial max_pfn_mapped
x86: Sanity check the e820 against the SRAT table using e820 map only
x86: Allow 1MB of slack between the e820 map and SRAT, not 4GB mm, x86: remove MEMORY_HOTPLUG_RESERVE related code
x86, mm: Fix node_possible_map logic
x86: fix system without memory on node0
Documentation/x86/x86_64/boot-options.txt | 5 -- Documentation/x86/x86_64/mm.txt | 9 ++- arch/x86/include/asm/numa_64.h | 10 ++- arch/x86/include/asm/page_32_types.h | 4 - arch/x86/include/asm/page_64_types.h | 8 +-- arch/x86/include/asm/page_types.h | 6 ++ arch/x86/include/asm/pgtable_64_types.h | 8 +- arch/x86/include/asm/pgtable_types.h | 1 - arch/x86/include/asm/sparsemem.h | 2 +- arch/x86/include/asm/traps.h | 1 + arch/x86/kernel/e820.c | 46 +++++++++++--- arch/x86/kernel/process.c | 14 ++++ arch/x86/kernel/process_32.c | 15 ----- arch/x86/kernel/process_64.c | 15 ----- arch/x86/kernel/setup.c | 12 ++++ arch/x86/kernel/setup_percpu.c | 8 +++ arch/x86/mm/dump_pagetables.c | 7 +- arch/x86/mm/fault.c | 51 +++------------ arch/x86/mm/init.c | 77 ++++++++++++++++++++--- arch/x86/mm/init_32.c | 61 +----------------- arch/x86/mm/init_64.c | 47 +------------- arch/x86/mm/numa_64.c | 33 +++------- arch/x86/mm/srat_64.c | 98 +++++------------------------ include/linux/mm.h | 2 - mm/page_alloc.c | 69 -------------------- 25 files changed, 213 insertions(+), 396 deletions(-)
Documentation/x86/x86_64/boot-options.txt +0 -5
@@ -150,11 +150,6 @@ NUMA Otherwise, the remaining system RAM is allocated to an additional node. - numa=hotadd=percent - Only allow hotadd memory to preallocate page structures upto - percent of already available memory. - numa=hotadd=0 will disable hotadd memory. - ACPI acpi=off Don't enable ACPI
Documentation/x86/x86_64/mm.txt +5 -4
@@ -6,10 +6,11 @@ Virtual memory map with 4 level page tables: 0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm hole caused by [48:63] sign extension ffff800000000000 - ffff80ffffffffff (=40 bits) guard hole -ffff880000000000 - ffffc0ffffffffff (=57 TB) direct mapping of all phys. memory -ffffc10000000000 - ffffc1ffffffffff (=40 bits) hole -ffffc20000000000 - ffffe1ffffffffff (=45 bits) vmalloc/ioremap space -ffffe20000000000 - ffffe2ffffffffff (=40 bits) virtual memory map (1TB) +ffff880000000000 - ffffc7ffffffffff (=64 TB) direct mapping of all phys. memory +ffffc80000000000 - ffffc8ffffffffff (=40 bits) hole +ffffc90000000000 - ffffe8ffffffffff (=45 bits) vmalloc/ioremap space +ffffe90000000000 - ffffe9ffffffffff (=40 bits) hole +ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB) ... unused hole ... ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0 ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space
arch/x86/include/asm/numa_64.h +7 -3
@@ -17,9 +17,6 @@ extern int compute_hash_shift(struct bootnode *nodes, int numblks,extern void numa_init_array (void );extern int numa_off; -extern void srat_reserve_add_area (int nodeid); -extern int hotadd_percent; -extern s16 apicid_to_node[MAX_LOCAL_APIC ];extern unsigned long numa_free_all_bootmem (void );
@@ -27,6 +24,13 @@ extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end);#ifdef CONFIG_NUMA +/* +* Too small node sizes may confuse the VM badly. Usually they +* result from BIOS bugs. So dont recognize nodes as standalone +* NUMA entities that have less than this amount of RAM listed: +*/ +#define NODE_MIN_SIZE (4*1024*1024) +extern void __init init_cpu_to_node (void );extern void __cpuinit numa_set_node (int cpu,int node);extern void __cpuinit numa_clear_node (int cpu);
arch/x86/include/asm/page_32_types.h +0 -4
@@ -54,10 +54,6 @@ extern unsigned int __VMALLOC_RESERVE;extern int sysctl_legacy_va_layout;extern void find_low_pfn_range (void ); -extern unsigned long init_memory_mapping (unsigned long start, -unsigned long end); -extern void initmem_init (unsigned long ,unsigned long ); -extern void free_initmem (void );extern void setup_bootmem_allocator (void );#endif /* !__ASSEMBLY__ */
arch/x86/include/asm/page_64_types.h +1 -7
@@ -47,7 +47,7 @@#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)#define __START_KERNEL_map _AC(0xffffffff80000000, UL) -/* See Documentation/x86_64/mm.txt for a description of the memory map. */ +/* See Documentation/x86/x86_64/mm.txt for a description of the memory map. */ #define __PHYSICAL_MASK_SHIFT 46#define __VIRTUAL_MASK_SHIFT 48
@@ -71,12 +71,6 @@ extern unsigned long __phys_addr(unsigned long);#define vmemmap ((struct page *)VMEMMAP_START) -extern unsigned long init_memory_mapping (unsigned long start, -unsigned long end); - -extern void initmem_init (unsigned long start_pfn,unsigned long end_pfn); -extern void free_initmem (void ); -extern void init_extra_mapping_uc (unsigned long phys,unsigned long size);extern void init_extra_mapping_wb (unsigned long phys,unsigned long size);
arch/x86/include/asm/page_types.h +6 -0
@@ -46,6 +46,12 @@ extern int devmem_is_allowed(unsigned long pagenr);extern unsigned long max_low_pfn_mapped;extern unsigned long max_pfn_mapped; +extern unsigned long init_memory_mapping (unsigned long start, +unsigned long end); + +extern void initmem_init (unsigned long start_pfn,unsigned long end_pfn); +extern void free_initmem (void ); +#endif /* !__ASSEMBLY__ */ #endif /* _ASM_X86_PAGE_DEFS_H */
arch/x86/include/asm/pgtable_64_types.h +4 -4
@@ -51,11 +51,11 @@ typedef struct { pteval_t pte; } pte_t;#define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT)#define PGDIR_MASK (~(PGDIR_SIZE - 1)) - +/* See Documentation/x86/x86_64/mm.txt for a description of the memory map. */ #define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL) -#define VMALLOC_START _AC(0xffffc20000000000, UL) -#define VMALLOC_END _AC(0xffffe1ffffffffff, UL) -#define VMEMMAP_START _AC(0xffffe20000000000, UL) +#define VMALLOC_START _AC(0xffffc90000000000, UL) +#define VMALLOC_END _AC(0xffffe8ffffffffff, UL) +#define VMEMMAP_START _AC(0xffffea0000000000, UL)#define MODULES_VADDR _AC(0xffffffffa0000000, UL)#define MODULES_END _AC(0xffffffffff000000, UL)#define MODULES_LEN (MODULES_END - MODULES_VADDR)
arch/x86/include/asm/pgtable_types.h +0 -1
@@ -273,7 +273,6 @@ typedef struct page *pgtable_t;extern pteval_t __supported_pte_mask;extern int nx_enabled; -extern void set_nx (void );#define pgprot_writecombine pgprot_writecombineextern pgprot_t pgprot_writecombine (pgprot_t prot);
arch/x86/include/asm/sparsemem.h +1 -1
@@ -27,7 +27,7 @@#else /* CONFIG_X86_32 */ # define SECTION_SIZE_BITS 27/* matt - 128 is convenient right now */ # define MAX_PHYSADDR_BITS 44 -# define MAX_PHYSMEM_BITS 44/* Can be max 45 bits */ +# define MAX_PHYSMEM_BITS 46#endif #endif /* CONFIG_SPARSEMEM */
arch/x86/include/asm/traps.h +1 -0
@@ -2,6 +2,7 @@#define _ASM_X86_TRAPS_H#include <asm/debugreg.h> +#include <asm/siginfo.h> /* TRAP_TRACE, ... */ #ifdef CONFIG_X86_32 #define dotraplinkage
arch/x86/kernel/e820.c +38 -8
71 lines not on this page · raw message
arch/x86/kernel/process.c +14 -0
@@ -8,6 +8,7 @@#include <linux/module.h> #include <linux/pm.h> #include <linux/clockchips.h> +#include <linux/random.h> #include <trace/power.h> #include <asm/system.h> #include <asm/apic.h>
@@ -613,3 +614,16 @@ static int __init idle_setup(char *str) }early_param ("idle" , idle_setup); +unsigned long arch_align_stack (unsigned long sp) +{ +if (!(current->personality &ADDR_NO_RANDOMIZE ) && randomize_va_space) + sp -=get_random_int () %8192 ; +return sp & ~0xf ; +} + +unsigned long arch_randomize_brk (struct mm_struct *mm) +{ +unsigned long range_end = mm->brk +0x02000000 ; +return randomize_range (mm->brk, range_end,0 ) ? : mm->brk; +} +
arch/x86/kernel/process_32.c +0 -15
@@ -9,8 +9,6 @@* This file handles the architecture-dependent parts of process handling.. */ -#include <stdarg.h> -#include <linux/stackprotector.h> #include <linux/cpu.h> #include <linux/errno.h>
@@ -33,7 +31,6 @@#include <linux/module.h> #include <linux/kallsyms.h> #include <linux/ptrace.h> -#include <linux/random.h> #include <linux/personality.h> #include <linux/tick.h> #include <linux/percpu.h>
@@ -497,15 +494,3 @@ unsigned long get_wchan(struct task_struct *p)return 0 ; } -unsigned long arch_align_stack (unsigned long sp) -{ -if (!(current->personality &ADDR_NO_RANDOMIZE ) && randomize_va_space) - sp -=get_random_int () %8192 ; -return sp & ~0xf ; -} - -unsigned long arch_randomize_brk (struct mm_struct *mm) -{ -unsigned long range_end = mm->brk +0x02000000 ; -return randomize_range (mm->brk, range_end,0 ) ? : mm->brk; -}
arch/x86/kernel/process_64.c +0 -15
@@ -14,8 +14,6 @@* This file handles the architecture-dependent parts of process handling.. */ -#include <stdarg.h> -#include <linux/stackprotector.h> #include <linux/cpu.h> #include <linux/errno.h>
@@ -32,7 +30,6 @@#include <linux/delay.h> #include <linux/module.h> #include <linux/ptrace.h> -#include <linux/random.h> #include <linux/notifier.h> #include <linux/kprobes.h> #include <linux/kdebug.h>
@@ -660,15 +657,3 @@ long sys_arch_prctl(int code, unsigned long addr)return do_arch_prctl (current, code, addr); } -unsigned long arch_align_stack (unsigned long sp) -{ -if (!(current->personality &ADDR_NO_RANDOMIZE ) && randomize_va_space) - sp -=get_random_int () %8192 ; -return sp & ~0xf ; -} - -unsigned long arch_randomize_brk (struct mm_struct *mm) -{ -unsigned long range_end = mm->brk +0x02000000 ; -return randomize_range (mm->brk, range_end,0 ) ? : mm->brk; -}
arch/x86/kernel/setup.c +12 -0
@@ -112,6 +112,14 @@#define ARCH_SETUP #endif +/* +* end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. +* The direct mapping extends to max_pfn_mapped, so that we can directly access +* apertures, ACPI and other tables without having to play with fixmaps. +*/ +unsigned long max_low_pfn_mapped; +unsigned long max_pfn_mapped; +RESERVE_BRK (dmi_alloc,65536 );unsigned int boot_cpu_id__read_mostly ;
@@ -854,12 +862,16 @@ void __init setup_arch(char **cmdline_p) max_low_pfn = max_pfn; high_memory = (void *)__va (max_pfn *PAGE_SIZE -1 ) +1 ; + max_pfn_mapped =KERNEL_IMAGE_SIZE >>PAGE_SHIFT ;#endif #ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION setup_bios_corruption_check ();#endif +printk (KERN_DEBUG "initial memory mapped : 0 - %08lx\n" , + max_pfn_mapped<<PAGE_SHIFT ); +reserve_brk ();/* max_pfn_mapped is updated here */
arch/x86/kernel/setup_percpu.c +8 -0
@@ -423,6 +423,14 @@ void __init setup_per_cpu_areas(void)early_per_cpu_ptr (x86_cpu_to_node_map) =NULL ;#endif +#if defined(CONFIG_X86_64 ) && defined(CONFIG_NUMA ) +/* +* make sure boot cpu node_number is right, when boot cpu is on the +* node that doesn't have mem installed +*/ +per_cpu (node_number, boot_cpu_id) =cpu_to_node (boot_cpu_id); +#endif +/* Setup node to cpumask map */ setup_node_to_cpumask_map ();
arch/x86/mm/dump_pagetables.c +4 -3
@@ -161,13 +161,14 @@ static void note_page(struct seq_file *m, struct pg_state *st, st->current_address >= st->marker[1].start_address) {const char *unit = units;unsigned long delta; +int width =sizeof (unsigned long ) *2 ;/* * Now print the actual finished series */ -seq_printf (m,"0x%p-0x%p " , - (void *)st->start_address, - (void *)st->current_address); +seq_printf (m,"0x%0*lx-0x%0*lx " , + width, st->start_address, + width, st->current_address); delta = (st->current_address - st->start_address) >>10 ;while (!(delta &1023 ) && unit[1 ]) {
arch/x86/mm/fault.c +11 -40
69 lines not on this page · raw message
arch/x86/mm/init.c +69 -8
112 lines not on this page · raw message
arch/x86/mm/init_32.c +3 -58
91 lines not on this page · raw message
arch/x86/mm/init_64.c +2 -45
76 lines not on this page · raw message
arch/x86/mm/numa_64.c +10 -23
@@ -179,18 +179,25 @@ static void * __init early_node_mem(int nodeid, unsigned long start, }/* Initialize bootmem allocator for a node */ -void __init setup_node_bootmem (int nodeid,unsigned long start, -unsigned long end) +void __init +setup_node_bootmem (int nodeid,unsigned long start,unsigned long end) {unsigned long start_pfn, last_pfn, bootmap_pages, bootmap_size; +const int pgdat_size =roundup (sizeof (pg_data_t),PAGE_SIZE );unsigned long bootmap_start, nodedata_phys;void *bootmap; -const int pgdat_size =roundup (sizeof (pg_data_t),PAGE_SIZE );int nid;if (!end)return ; +/* +* Don't confuse VM with a node that doesn't have the +* minimum amount of memory: +*/ +if (end && (end - start) <NODE_MIN_SIZE ) +return ; + start =roundup (start,ZONE_ALIGN ); printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid,
@@ -272,9 +279,6 @@ void __init setup_node_bootmem(int nodeid, unsigned long start,reserve_bootmem_node (NODE_DATA (nodeid), bootmap_start, bootmap_pages<<PAGE_SHIFT ,BOOTMEM_DEFAULT ); -#ifdef CONFIG_ACPI_NUMA -srat_reserve_add_area (nodeid); -#endif node_set_online (nodeid); }
@@ -578,21 +582,6 @@ unsigned long __init numa_free_all_bootmem(void)return pages; } -void __init paging_init (void ) -{ -unsigned long max_zone_pfns[MAX_NR_ZONES ]; - -memset (max_zone_pfns,0 ,sizeof (max_zone_pfns)); - max_zone_pfns[ZONE_DMA ] =MAX_DMA_PFN ; - max_zone_pfns[ZONE_DMA32 ] =MAX_DMA32_PFN ; - max_zone_pfns[ZONE_NORMAL ] = max_pfn; - -sparse_memory_present_with_active_regions (MAX_NUMNODES ); -sparse_init (); - -free_area_init_nodes (max_zone_pfns); -} -static __init int numa_setup (char *opt) {if (!opt)
@@ -606,8 +595,6 @@ static __init int numa_setup(char *opt)#ifdef CONFIG_ACPI_NUMA if (!strncmp (opt,"noacpi" ,6 )) acpi_numa =-1 ; -if (!strncmp (opt,"hotadd=" ,7 )) - hotadd_percent =simple_strtoul (opt+7 ,NULL ,10 );#endif return 0 ; }
arch/x86/mm/srat_64.c +17 -81
194 lines not on this page · raw message
include/linux/mm.h +0 -2
@@ -1031,8 +1031,6 @@ extern void add_active_range(unsigned int nid, unsigned long start_pfn, unsigned long end_pfn);extern void remove_active_range (unsigned int nid,unsigned long start_pfn,unsigned long end_pfn); -extern void push_node_boundaries (unsigned int nid,unsigned long start_pfn, -unsigned long end_pfn);extern void remove_all_active_ranges (void );extern unsigned long absent_pages_in_range (unsigned long start_pfn,unsigned long end_pfn);
mm/page_alloc.c +0 -69
93 lines not on this page · raw message