linux-mips
[Top] [All Lists]

[RFC][PATCH] MIPS: Use pagefault_{dis,en}able for k{,un}map_coherent

To: ralf@linux-mips.org
Subject: [RFC][PATCH] MIPS: Use pagefault_{dis,en}able for k{,un}map_coherent
From: Peter Zijlstra <peterz@infradead.org>
Date: Tue, 10 Sep 2013 13:33:22 +0200
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2012-12-30)
Hi Ralf,

I was poking about the preempt_count muck and stumbled upon this..

Should you be using the pagefault_*() methods here?

--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -124,7 +124,7 @@ void *kmap_coherent(struct page *page, u
 
        BUG_ON(Page_dcache_dirty(page));
 
-       inc_preempt_count();
+       pagefault_disable();
        idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
 #ifdef CONFIG_MIPS_MT_SMTC
        idx += FIX_N_COLOURS * smp_processor_id() +
@@ -193,8 +193,7 @@ void kunmap_coherent(void)
        write_c0_entryhi(old_ctx);
        EXIT_CRITICAL(flags);
 #endif
-       dec_preempt_count();
-       preempt_check_resched();
+       pagefault_enable();
 }
 
 void copy_user_highpage(struct page *to, struct page *from,

<Prev in Thread] Current Thread [Next in Thread>
  • [RFC][PATCH] MIPS: Use pagefault_{dis,en}able for k{,un}map_coherent, Peter Zijlstra <=