| From ab70f1d5819af93e041cbd88dcd310f60b5d83ba Mon Sep 17 00:00:00 2001 |
| From: Peter Zijlstra <a.p.zijlstra@chello.nl> |
| Date: Fri, 3 Jul 2009 08:30:37 -0500 |
| Subject: [PATCH] sparc: Prepare decoupling of page-fault logic from preempt-count |
| |
| commit ab70f1d5819af93e041cbd88dcd310f60b5d83ba in tip. |
| |
| With the separation of pagefault_{disable,enable}() from the |
| preempt_count a previously overlooked dependancy became painfully |
| clear. |
| |
| kmap_atomic() is per cpu and relies not only on disabling the |
| pagefault handler, but really needs preemption disabled too. |
| |
| Make this explicit now - so that we can change pagefault_disable(). |
| |
| Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> |
| Signed-off-by: Ingo Molnar <mingo@elte.hu> |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| |
| diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c |
| index 7916feb..a9f414c 100644 |
| --- a/arch/sparc/mm/highmem.c |
| +++ b/arch/sparc/mm/highmem.c |
| @@ -34,7 +34,7 @@ void *kmap_atomic(struct page *page, enum km_type type) |
| unsigned long idx; |
| unsigned long vaddr; |
| |
| - /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ |
| + preempt_disable(); |
| pagefault_disable(); |
| if (!PageHighMem(page)) |
| return page_address(page); |
| @@ -73,6 +73,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type) |
| |
| if (vaddr < FIXADDR_START) { // FIXME |
| pagefault_enable(); |
| + preempt_enable(); |
| return; |
| } |
| |
| @@ -99,6 +100,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type) |
| #endif |
| |
| pagefault_enable(); |
| + preempt_enable(); |
| } |
| EXPORT_SYMBOL(kunmap_atomic); |
| |
| -- |
| 1.7.1.1 |
| |