public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] MIPS: Use pagefault_{dis,en}able for k{,un}map_coherent
@ 2013-09-10 11:33 Peter Zijlstra
  0 siblings, 0 replies; only message in thread
From: Peter Zijlstra @ 2013-09-10 11:33 UTC (permalink / raw)
  To: ralf; +Cc: linux-kernel, linux-mips

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,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-10 11:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10 11:33 [RFC][PATCH] MIPS: Use pagefault_{dis,en}able for k{,un}map_coherent Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox