diff options
author | Tejun Heo <tj@kernel.org> | 2009-08-14 01:41:02 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-08-14 01:45:31 -0400 |
commit | 384be2b18a5f9475eab9ca2bdfa95cc1a04ef59c (patch) | |
tree | 04c93f391a1b65c8bf8d7ba8643c07d26c26590a /arch/x86/mm | |
parent | a76761b621bcd8336065c4fe3a74f046858bc34c (diff) | |
parent | 142d44b0dd6741a64a7bdbe029110e7c1dcf1d23 (diff) |
Merge branch 'percpu-for-linus' into percpu-for-next
Conflicts:
arch/sparc/kernel/smp_64.c
arch/x86/kernel/cpu/perf_counter.c
arch/x86/kernel/setup_percpu.c
drivers/cpufreq/cpufreq_ondemand.c
mm/percpu.c
Conflicts in core and arch percpu codes are mostly from commit
ed78e1e078dd44249f88b1dd8c76dafb39567161 which substituted many
num_possible_cpus() with nr_cpu_ids. As for-next branch has moved all
the first chunk allocators into mm/percpu.c, the changes are moved
from arch code to mm/percpu.c.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/fault.c | 11 | ||||
-rw-r--r-- | arch/x86/mm/highmem_32.c | 1 | ||||
-rw-r--r-- | arch/x86/mm/init.c | 1 | ||||
-rw-r--r-- | arch/x86/mm/init_64.c | 11 | ||||
-rw-r--r-- | arch/x86/mm/pageattr.c | 39 | ||||
-rw-r--r-- | arch/x86/mm/pgtable.c | 7 | ||||
-rw-r--r-- | arch/x86/mm/srat_64.c | 6 |
7 files changed, 51 insertions, 25 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 78a5fff857be..bfae139182ff 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -426,10 +426,11 @@ static noinline int vmalloc_fault(unsigned long address) | |||
426 | } | 426 | } |
427 | 427 | ||
428 | static const char errata93_warning[] = | 428 | static const char errata93_warning[] = |
429 | KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n" | 429 | KERN_ERR |
430 | KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n" | 430 | "******* Your BIOS seems to not contain a fix for K8 errata #93\n" |
431 | KERN_ERR "******* Please consider a BIOS update.\n" | 431 | "******* Working around it, but it may cause SEGVs or burn power.\n" |
432 | KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n"; | 432 | "******* Please consider a BIOS update.\n" |
433 | "******* Disabling USB legacy in the BIOS may also help.\n"; | ||
433 | 434 | ||
434 | /* | 435 | /* |
435 | * No vm86 mode in 64-bit mode: | 436 | * No vm86 mode in 64-bit mode: |
@@ -696,7 +697,7 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code, | |||
696 | if (!printk_ratelimit()) | 697 | if (!printk_ratelimit()) |
697 | return; | 698 | return; |
698 | 699 | ||
699 | printk(KERN_CONT "%s%s[%d]: segfault at %lx ip %p sp %p error %lx", | 700 | printk("%s%s[%d]: segfault at %lx ip %p sp %p error %lx", |
700 | task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, | 701 | task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, |
701 | tsk->comm, task_pid_nr(tsk), address, | 702 | tsk->comm, task_pid_nr(tsk), address, |
702 | (void *)regs->ip, (void *)regs->sp, error_code); | 703 | (void *)regs->ip, (void *)regs->sp, error_code); |
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index 58f621e81919..2112ed55e7ea 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c | |||
@@ -103,6 +103,7 @@ EXPORT_SYMBOL(kmap); | |||
103 | EXPORT_SYMBOL(kunmap); | 103 | EXPORT_SYMBOL(kunmap); |
104 | EXPORT_SYMBOL(kmap_atomic); | 104 | EXPORT_SYMBOL(kmap_atomic); |
105 | EXPORT_SYMBOL(kunmap_atomic); | 105 | EXPORT_SYMBOL(kunmap_atomic); |
106 | EXPORT_SYMBOL(kmap_atomic_prot); | ||
106 | 107 | ||
107 | void __init set_highmem_pages_init(void) | 108 | void __init set_highmem_pages_init(void) |
108 | { | 109 | { |
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 47ce9a2ce5e7..0607119cef94 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/system.h> | 12 | #include <asm/system.h> |
13 | #include <asm/tlbflush.h> | 13 | #include <asm/tlbflush.h> |
14 | #include <asm/tlb.h> | 14 | #include <asm/tlb.h> |
15 | #include <asm/proto.h> | ||
15 | 16 | ||
16 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | 17 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); |
17 | 18 | ||
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index b177652251a4..6176fe8f29e0 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -598,8 +598,15 @@ void __init paging_init(void) | |||
598 | 598 | ||
599 | sparse_memory_present_with_active_regions(MAX_NUMNODES); | 599 | sparse_memory_present_with_active_regions(MAX_NUMNODES); |
600 | sparse_init(); | 600 | sparse_init(); |
601 | /* clear the default setting with node 0 */ | 601 | |
602 | nodes_clear(node_states[N_NORMAL_MEMORY]); | 602 | /* |
603 | * clear the default setting with node 0 | ||
604 | * note: don't use nodes_clear here, that is really clearing when | ||
605 | * numa support is not compiled in, and later node_set_state | ||
606 | * will not set it back. | ||
607 | */ | ||
608 | node_clear_state(0, N_NORMAL_MEMORY); | ||
609 | |||
603 | free_area_init_nodes(max_zone_pfns); | 610 | free_area_init_nodes(max_zone_pfns); |
604 | } | 611 | } |
605 | 612 | ||
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index c106f7852424..dce282f65700 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -592,9 +592,12 @@ static int __change_page_attr(struct cpa_data *cpa, int primary) | |||
592 | unsigned int level; | 592 | unsigned int level; |
593 | pte_t *kpte, old_pte; | 593 | pte_t *kpte, old_pte; |
594 | 594 | ||
595 | if (cpa->flags & CPA_PAGES_ARRAY) | 595 | if (cpa->flags & CPA_PAGES_ARRAY) { |
596 | address = (unsigned long)page_address(cpa->pages[cpa->curpage]); | 596 | struct page *page = cpa->pages[cpa->curpage]; |
597 | else if (cpa->flags & CPA_ARRAY) | 597 | if (unlikely(PageHighMem(page))) |
598 | return 0; | ||
599 | address = (unsigned long)page_address(page); | ||
600 | } else if (cpa->flags & CPA_ARRAY) | ||
598 | address = cpa->vaddr[cpa->curpage]; | 601 | address = cpa->vaddr[cpa->curpage]; |
599 | else | 602 | else |
600 | address = *cpa->vaddr; | 603 | address = *cpa->vaddr; |
@@ -698,9 +701,12 @@ static int cpa_process_alias(struct cpa_data *cpa) | |||
698 | * No need to redo, when the primary call touched the direct | 701 | * No need to redo, when the primary call touched the direct |
699 | * mapping already: | 702 | * mapping already: |
700 | */ | 703 | */ |
701 | if (cpa->flags & CPA_PAGES_ARRAY) | 704 | if (cpa->flags & CPA_PAGES_ARRAY) { |
702 | vaddr = (unsigned long)page_address(cpa->pages[cpa->curpage]); | 705 | struct page *page = cpa->pages[cpa->curpage]; |
703 | else if (cpa->flags & CPA_ARRAY) | 706 | if (unlikely(PageHighMem(page))) |
707 | return 0; | ||
708 | vaddr = (unsigned long)page_address(page); | ||
709 | } else if (cpa->flags & CPA_ARRAY) | ||
704 | vaddr = cpa->vaddr[cpa->curpage]; | 710 | vaddr = cpa->vaddr[cpa->curpage]; |
705 | else | 711 | else |
706 | vaddr = *cpa->vaddr; | 712 | vaddr = *cpa->vaddr; |
@@ -998,12 +1004,15 @@ EXPORT_SYMBOL(set_memory_array_uc); | |||
998 | int _set_memory_wc(unsigned long addr, int numpages) | 1004 | int _set_memory_wc(unsigned long addr, int numpages) |
999 | { | 1005 | { |
1000 | int ret; | 1006 | int ret; |
1007 | unsigned long addr_copy = addr; | ||
1008 | |||
1001 | ret = change_page_attr_set(&addr, numpages, | 1009 | ret = change_page_attr_set(&addr, numpages, |
1002 | __pgprot(_PAGE_CACHE_UC_MINUS), 0); | 1010 | __pgprot(_PAGE_CACHE_UC_MINUS), 0); |
1003 | |||
1004 | if (!ret) { | 1011 | if (!ret) { |
1005 | ret = change_page_attr_set(&addr, numpages, | 1012 | ret = change_page_attr_set_clr(&addr_copy, numpages, |
1006 | __pgprot(_PAGE_CACHE_WC), 0); | 1013 | __pgprot(_PAGE_CACHE_WC), |
1014 | __pgprot(_PAGE_CACHE_MASK), | ||
1015 | 0, 0, NULL); | ||
1007 | } | 1016 | } |
1008 | return ret; | 1017 | return ret; |
1009 | } | 1018 | } |
@@ -1120,7 +1129,9 @@ int set_pages_array_uc(struct page **pages, int addrinarray) | |||
1120 | int free_idx; | 1129 | int free_idx; |
1121 | 1130 | ||
1122 | for (i = 0; i < addrinarray; i++) { | 1131 | for (i = 0; i < addrinarray; i++) { |
1123 | start = (unsigned long)page_address(pages[i]); | 1132 | if (PageHighMem(pages[i])) |
1133 | continue; | ||
1134 | start = page_to_pfn(pages[i]) << PAGE_SHIFT; | ||
1124 | end = start + PAGE_SIZE; | 1135 | end = start + PAGE_SIZE; |
1125 | if (reserve_memtype(start, end, _PAGE_CACHE_UC_MINUS, NULL)) | 1136 | if (reserve_memtype(start, end, _PAGE_CACHE_UC_MINUS, NULL)) |
1126 | goto err_out; | 1137 | goto err_out; |
@@ -1133,7 +1144,9 @@ int set_pages_array_uc(struct page **pages, int addrinarray) | |||
1133 | err_out: | 1144 | err_out: |
1134 | free_idx = i; | 1145 | free_idx = i; |
1135 | for (i = 0; i < free_idx; i++) { | 1146 | for (i = 0; i < free_idx; i++) { |
1136 | start = (unsigned long)page_address(pages[i]); | 1147 | if (PageHighMem(pages[i])) |
1148 | continue; | ||
1149 | start = page_to_pfn(pages[i]) << PAGE_SHIFT; | ||
1137 | end = start + PAGE_SIZE; | 1150 | end = start + PAGE_SIZE; |
1138 | free_memtype(start, end); | 1151 | free_memtype(start, end); |
1139 | } | 1152 | } |
@@ -1162,7 +1175,9 @@ int set_pages_array_wb(struct page **pages, int addrinarray) | |||
1162 | return retval; | 1175 | return retval; |
1163 | 1176 | ||
1164 | for (i = 0; i < addrinarray; i++) { | 1177 | for (i = 0; i < addrinarray; i++) { |
1165 | start = (unsigned long)page_address(pages[i]); | 1178 | if (PageHighMem(pages[i])) |
1179 | continue; | ||
1180 | start = page_to_pfn(pages[i]) << PAGE_SHIFT; | ||
1166 | end = start + PAGE_SIZE; | 1181 | end = start + PAGE_SIZE; |
1167 | free_memtype(start, end); | 1182 | free_memtype(start, end); |
1168 | } | 1183 | } |
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 8e43bdd45456..ed34f5e35999 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -25,7 +25,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
25 | return pte; | 25 | return pte; |
26 | } | 26 | } |
27 | 27 | ||
28 | void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte) | 28 | void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte) |
29 | { | 29 | { |
30 | pgtable_page_dtor(pte); | 30 | pgtable_page_dtor(pte); |
31 | paravirt_release_pte(page_to_pfn(pte)); | 31 | paravirt_release_pte(page_to_pfn(pte)); |
@@ -33,14 +33,14 @@ void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte) | |||
33 | } | 33 | } |
34 | 34 | ||
35 | #if PAGETABLE_LEVELS > 2 | 35 | #if PAGETABLE_LEVELS > 2 |
36 | void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | 36 | void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) |
37 | { | 37 | { |
38 | paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT); | 38 | paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT); |
39 | tlb_remove_page(tlb, virt_to_page(pmd)); | 39 | tlb_remove_page(tlb, virt_to_page(pmd)); |
40 | } | 40 | } |
41 | 41 | ||
42 | #if PAGETABLE_LEVELS > 3 | 42 | #if PAGETABLE_LEVELS > 3 |
43 | void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) | 43 | void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) |
44 | { | 44 | { |
45 | paravirt_release_pud(__pa(pud) >> PAGE_SHIFT); | 45 | paravirt_release_pud(__pa(pud) >> PAGE_SHIFT); |
46 | tlb_remove_page(tlb, virt_to_page(pud)); | 46 | tlb_remove_page(tlb, virt_to_page(pud)); |
@@ -329,7 +329,6 @@ void __init reserve_top_address(unsigned long reserve) | |||
329 | printk(KERN_INFO "Reserving virtual address space above 0x%08x\n", | 329 | printk(KERN_INFO "Reserving virtual address space above 0x%08x\n", |
330 | (int)-reserve); | 330 | (int)-reserve); |
331 | __FIXADDR_TOP = -reserve - PAGE_SIZE; | 331 | __FIXADDR_TOP = -reserve - PAGE_SIZE; |
332 | __VMALLOC_RESERVE += reserve; | ||
333 | #endif | 332 | #endif |
334 | } | 333 | } |
335 | 334 | ||
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index 2dfcbf9df2ae..dbb5381f7b3b 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -79,8 +79,10 @@ static __init void bad_srat(void) | |||
79 | acpi_numa = -1; | 79 | acpi_numa = -1; |
80 | for (i = 0; i < MAX_LOCAL_APIC; i++) | 80 | for (i = 0; i < MAX_LOCAL_APIC; i++) |
81 | apicid_to_node[i] = NUMA_NO_NODE; | 81 | apicid_to_node[i] = NUMA_NO_NODE; |
82 | for (i = 0; i < MAX_NUMNODES; i++) | 82 | for (i = 0; i < MAX_NUMNODES; i++) { |
83 | nodes_add[i].start = nodes[i].end = 0; | 83 | nodes[i].start = nodes[i].end = 0; |
84 | nodes_add[i].start = nodes_add[i].end = 0; | ||
85 | } | ||
84 | remove_all_active_ranges(); | 86 | remove_all_active_ranges(); |
85 | } | 87 | } |
86 | 88 | ||