aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2006-12-06 23:32:20 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:21 -0500
commita866374aecc90c7d90619727ccd851ac096b2fc7 (patch)
treeeabae0b36b5281dcef20563470c7f05549689b8c /arch/mips/mm
parent6edaf68a87d17570790fd55f0c451a29ec1d6703 (diff)
[PATCH] mm: pagefault_{disable,enable}()
Introduce pagefault_{disable,enable}() and use these where previously we did manual preempt increments/decrements to make the pagefault handler do the atomic thing. Currently they still rely on the increased preempt count, but do not rely on the disabled preemption, this might go away in the future. (NOTE: the extra barrier() in pagefault_disable might fix some holes on machines which have too many registers for their own good) [heiko.carstens@de.ibm.com: s390 fix] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Nick Piggin <npiggin@suse.de> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/mips/mm')
-rw-r--r--arch/mips/mm/highmem.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index 99ebf3ccc222..675502ada5a2 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -39,7 +39,7 @@ void *__kmap_atomic(struct page *page, enum km_type type)
39 unsigned long vaddr; 39 unsigned long vaddr;
40 40
41 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ 41 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
42 inc_preempt_count(); 42 pagefault_disable();
43 if (!PageHighMem(page)) 43 if (!PageHighMem(page))
44 return page_address(page); 44 return page_address(page);
45 45
@@ -62,8 +62,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
62 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); 62 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
63 63
64 if (vaddr < FIXADDR_START) { // FIXME 64 if (vaddr < FIXADDR_START) { // FIXME
65 dec_preempt_count(); 65 pagefault_enable();
66 preempt_check_resched();
67 return; 66 return;
68 } 67 }
69 68
@@ -78,8 +77,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
78 local_flush_tlb_one(vaddr); 77 local_flush_tlb_one(vaddr);
79#endif 78#endif
80 79
81 dec_preempt_count(); 80 pagefault_enable();
82 preempt_check_resched();
83} 81}
84 82
85#ifndef CONFIG_LIMITED_DMA 83#ifndef CONFIG_LIMITED_DMA
@@ -92,7 +90,7 @@ void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
92 enum fixed_addresses idx; 90 enum fixed_addresses idx;
93 unsigned long vaddr; 91 unsigned long vaddr;
94 92
95 inc_preempt_count(); 93 pagefault_disable();
96 94
97 idx = type + KM_TYPE_NR*smp_processor_id(); 95 idx = type + KM_TYPE_NR*smp_processor_id();
98 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); 96 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);