diff options
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 3 | ||||
-rw-r--r-- | arch/ia64/mm/discontig.c | 7 | ||||
-rw-r--r-- | arch/ia64/mm/fault.c | 34 | ||||
-rw-r--r-- | arch/ia64/mm/init.c | 13 | ||||
-rw-r--r-- | arch/ia64/mm/tlb.c | 2 |
5 files changed, 21 insertions, 38 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index d71731ee5b61..f7dfc107cb7b 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2352,7 +2352,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon | |||
2352 | insert_vm_struct(mm, vma); | 2352 | insert_vm_struct(mm, vma); |
2353 | 2353 | ||
2354 | mm->total_vm += size >> PAGE_SHIFT; | 2354 | mm->total_vm += size >> PAGE_SHIFT; |
2355 | vm_stat_account(vma); | 2355 | vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, |
2356 | vma_pages(vma)); | ||
2356 | up_write(&task->mm->mmap_sem); | 2357 | up_write(&task->mm->mmap_sem); |
2357 | 2358 | ||
2358 | /* | 2359 | /* |
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index a3788fb84809..a88cdb7232f8 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
@@ -555,9 +555,13 @@ void show_mem(void) | |||
555 | show_free_areas(); | 555 | show_free_areas(); |
556 | printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); | 556 | printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); |
557 | for_each_pgdat(pgdat) { | 557 | for_each_pgdat(pgdat) { |
558 | unsigned long present = pgdat->node_present_pages; | 558 | unsigned long present; |
559 | unsigned long flags; | ||
559 | int shared = 0, cached = 0, reserved = 0; | 560 | int shared = 0, cached = 0, reserved = 0; |
561 | |||
560 | printk("Node ID: %d\n", pgdat->node_id); | 562 | printk("Node ID: %d\n", pgdat->node_id); |
563 | pgdat_resize_lock(pgdat, &flags); | ||
564 | present = pgdat->node_present_pages; | ||
561 | for(i = 0; i < pgdat->node_spanned_pages; i++) { | 565 | for(i = 0; i < pgdat->node_spanned_pages; i++) { |
562 | struct page *page; | 566 | struct page *page; |
563 | if (pfn_valid(pgdat->node_start_pfn + i)) | 567 | if (pfn_valid(pgdat->node_start_pfn + i)) |
@@ -571,6 +575,7 @@ void show_mem(void) | |||
571 | else if (page_count(page)) | 575 | else if (page_count(page)) |
572 | shared += page_count(page)-1; | 576 | shared += page_count(page)-1; |
573 | } | 577 | } |
578 | pgdat_resize_unlock(pgdat, &flags); | ||
574 | total_present += present; | 579 | total_present += present; |
575 | total_reserved += reserved; | 580 | total_reserved += reserved; |
576 | total_cached += cached; | 581 | total_cached += cached; |
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index 3c32af910d60..af7eb087dca7 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c | |||
@@ -20,32 +20,6 @@ | |||
20 | extern void die (char *, struct pt_regs *, long); | 20 | extern void die (char *, struct pt_regs *, long); |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * This routine is analogous to expand_stack() but instead grows the | ||
24 | * register backing store (which grows towards higher addresses). | ||
25 | * Since the register backing store is access sequentially, we | ||
26 | * disallow growing the RBS by more than a page at a time. Note that | ||
27 | * the VM_GROWSUP flag can be set on any VM area but that's fine | ||
28 | * because the total process size is still limited by RLIMIT_STACK and | ||
29 | * RLIMIT_AS. | ||
30 | */ | ||
31 | static inline long | ||
32 | expand_backing_store (struct vm_area_struct *vma, unsigned long address) | ||
33 | { | ||
34 | unsigned long grow; | ||
35 | |||
36 | grow = PAGE_SIZE >> PAGE_SHIFT; | ||
37 | if (address - vma->vm_start > current->signal->rlim[RLIMIT_STACK].rlim_cur | ||
38 | || (((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) > current->signal->rlim[RLIMIT_AS].rlim_cur)) | ||
39 | return -ENOMEM; | ||
40 | vma->vm_end += PAGE_SIZE; | ||
41 | vma->vm_mm->total_vm += grow; | ||
42 | if (vma->vm_flags & VM_LOCKED) | ||
43 | vma->vm_mm->locked_vm += grow; | ||
44 | __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, grow); | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * Return TRUE if ADDRESS points at a page in the kernel's mapped segment | 23 | * Return TRUE if ADDRESS points at a page in the kernel's mapped segment |
50 | * (inside region 5, on ia64) and that page is present. | 24 | * (inside region 5, on ia64) and that page is present. |
51 | */ | 25 | */ |
@@ -185,7 +159,13 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re | |||
185 | if (REGION_NUMBER(address) != REGION_NUMBER(vma->vm_start) | 159 | if (REGION_NUMBER(address) != REGION_NUMBER(vma->vm_start) |
186 | || REGION_OFFSET(address) >= RGN_MAP_LIMIT) | 160 | || REGION_OFFSET(address) >= RGN_MAP_LIMIT) |
187 | goto bad_area; | 161 | goto bad_area; |
188 | if (expand_backing_store(vma, address)) | 162 | /* |
163 | * Since the register backing store is accessed sequentially, | ||
164 | * we disallow growing it by more than a page at a time. | ||
165 | */ | ||
166 | if (address > vma->vm_end + PAGE_SIZE - sizeof(long)) | ||
167 | goto bad_area; | ||
168 | if (expand_upwards(vma, address)) | ||
189 | goto bad_area; | 169 | goto bad_area; |
190 | } | 170 | } |
191 | goto good_area; | 171 | goto good_area; |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 98246acd4991..e3215ba64ffd 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -158,7 +158,7 @@ ia64_init_addr_space (void) | |||
158 | vma->vm_start = current->thread.rbs_bot & PAGE_MASK; | 158 | vma->vm_start = current->thread.rbs_bot & PAGE_MASK; |
159 | vma->vm_end = vma->vm_start + PAGE_SIZE; | 159 | vma->vm_end = vma->vm_start + PAGE_SIZE; |
160 | vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7]; | 160 | vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7]; |
161 | vma->vm_flags = VM_DATA_DEFAULT_FLAGS | VM_GROWSUP; | 161 | vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT; |
162 | down_write(¤t->mm->mmap_sem); | 162 | down_write(¤t->mm->mmap_sem); |
163 | if (insert_vm_struct(current->mm, vma)) { | 163 | if (insert_vm_struct(current->mm, vma)) { |
164 | up_write(¤t->mm->mmap_sem); | 164 | up_write(¤t->mm->mmap_sem); |
@@ -275,26 +275,21 @@ put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot) | |||
275 | 275 | ||
276 | pgd = pgd_offset_k(address); /* note: this is NOT pgd_offset()! */ | 276 | pgd = pgd_offset_k(address); /* note: this is NOT pgd_offset()! */ |
277 | 277 | ||
278 | spin_lock(&init_mm.page_table_lock); | ||
279 | { | 278 | { |
280 | pud = pud_alloc(&init_mm, pgd, address); | 279 | pud = pud_alloc(&init_mm, pgd, address); |
281 | if (!pud) | 280 | if (!pud) |
282 | goto out; | 281 | goto out; |
283 | |||
284 | pmd = pmd_alloc(&init_mm, pud, address); | 282 | pmd = pmd_alloc(&init_mm, pud, address); |
285 | if (!pmd) | 283 | if (!pmd) |
286 | goto out; | 284 | goto out; |
287 | pte = pte_alloc_map(&init_mm, pmd, address); | 285 | pte = pte_alloc_kernel(pmd, address); |
288 | if (!pte) | 286 | if (!pte) |
289 | goto out; | 287 | goto out; |
290 | if (!pte_none(*pte)) { | 288 | if (!pte_none(*pte)) |
291 | pte_unmap(pte); | ||
292 | goto out; | 289 | goto out; |
293 | } | ||
294 | set_pte(pte, mk_pte(page, pgprot)); | 290 | set_pte(pte, mk_pte(page, pgprot)); |
295 | pte_unmap(pte); | ||
296 | } | 291 | } |
297 | out: spin_unlock(&init_mm.page_table_lock); | 292 | out: |
298 | /* no need for flush_tlb */ | 293 | /* no need for flush_tlb */ |
299 | return page; | 294 | return page; |
300 | } | 295 | } |
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c index c93e0f2b5fea..c79a9b96d02b 100644 --- a/arch/ia64/mm/tlb.c +++ b/arch/ia64/mm/tlb.c | |||
@@ -158,10 +158,12 @@ flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long | |||
158 | # ifdef CONFIG_SMP | 158 | # ifdef CONFIG_SMP |
159 | platform_global_tlb_purge(mm, start, end, nbits); | 159 | platform_global_tlb_purge(mm, start, end, nbits); |
160 | # else | 160 | # else |
161 | preempt_disable(); | ||
161 | do { | 162 | do { |
162 | ia64_ptcl(start, (nbits<<2)); | 163 | ia64_ptcl(start, (nbits<<2)); |
163 | start += (1UL << nbits); | 164 | start += (1UL << nbits); |
164 | } while (start < end); | 165 | } while (start < end); |
166 | preempt_enable(); | ||
165 | # endif | 167 | # endif |
166 | 168 | ||
167 | ia64_srlz_i(); /* srlz.i implies srlz.d */ | 169 | ia64_srlz_i(); /* srlz.i implies srlz.d */ |