aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc/highmem.h
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 /include/asm-ppc/highmem.h
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 'include/asm-ppc/highmem.h')
-rw-r--r--include/asm-ppc/highmem.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
index 1d2c4ef81c22..f7b21ee302b4 100644
--- a/include/asm-ppc/highmem.h
+++ b/include/asm-ppc/highmem.h
@@ -79,7 +79,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
79 unsigned long vaddr; 79 unsigned long vaddr;
80 80
81 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ 81 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
82 inc_preempt_count(); 82 pagefault_disable();
83 if (!PageHighMem(page)) 83 if (!PageHighMem(page))
84 return page_address(page); 84 return page_address(page);
85 85
@@ -101,8 +101,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
101 unsigned int idx = type + KM_TYPE_NR*smp_processor_id(); 101 unsigned int idx = type + KM_TYPE_NR*smp_processor_id();
102 102
103 if (vaddr < KMAP_FIX_BEGIN) { // FIXME 103 if (vaddr < KMAP_FIX_BEGIN) { // FIXME
104 dec_preempt_count(); 104 pagefault_enable();
105 preempt_check_resched();
106 return; 105 return;
107 } 106 }
108 107
@@ -115,8 +114,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
115 pte_clear(&init_mm, vaddr, kmap_pte+idx); 114 pte_clear(&init_mm, vaddr, kmap_pte+idx);
116 flush_tlb_page(NULL, vaddr); 115 flush_tlb_page(NULL, vaddr);
117#endif 116#endif
118 dec_preempt_count(); 117 pagefault_enable();
119 preempt_check_resched();
120} 118}
121 119
122static inline struct page *kmap_atomic_to_page(void *ptr) 120static inline struct page *kmap_atomic_to_page(void *ptr)