Re: 2.6.27-rc1-mm1: sparc64 BUG: using smp_processor_id() in preemptible code

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <m.kozlowski@...>
Cc: <akpm@...>, <linux-kernel@...>, <kernel-testers@...>, <sparclinux@...>
Date: Sunday, August 3, 2008 - 3:02 am

From: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Date: Sat, 2 Aug 2008 17:17:47 +0200


Thenk for the report and sample patch.

I've decided to put the preemption disabled call at the smp_tsb_sync() call
site so that smp_tsb_sync() can still invoke smp_call_function_mask() as
a tail-call.

Thanks again!

sparc64: Need to disable preemption around smp_tsb_sync().

Based upon a bug report by Mariusz Kozlowski

It uses smp_call_function_masked() now, which has a preemption-disabled
requirement.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc64/mm/tsb.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/sparc64/mm/tsb.c b/arch/sparc64/mm/tsb.c
index 3547937..587f8ef 100644
--- a/arch/sparc64/mm/tsb.c
+++ b/arch/sparc64/mm/tsb.c
@@ -1,9 +1,10 @@
 /* arch/sparc64/mm/tsb.c
  *
- * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
+ * Copyright (C) 2006, 2008 David S. Miller <davem@davemloft.net>
  */
 
 #include <linux/kernel.h>
+#include <linux/preempt.h>
 #include <asm/system.h>
 #include <asm/page.h>
 #include <asm/tlbflush.h>
@@ -415,7 +416,9 @@ retry_tsb_alloc:
 		tsb_context_switch(mm);
 
 		/* Now force other processors to do the same.  */
+		preempt_disable();
 		smp_tsb_sync(mm);
+		preempt_enable();
 
 		/* Now it is safe to free the old tsb.  */
 		kmem_cache_free(tsb_caches[old_cache_index], old_tsb);
-- 
1.5.6.GIT

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.27-rc1-mm1, Andrew Morton, (Thu Jul 31, 3:03 am)
Re: 2.6.27-rc1-mm1: unable to boot with gcov on x86_64, Mariusz Kozlowski, (Tue Aug 5, 4:26 pm)
Re: 2.6.27-rc1-mm1: unable to boot with gcov on x86_64, Peter Oberparleiter, (Wed Aug 6, 3:23 am)
Re: 2.6.27-rc1-mm1: unable to boot with gcov on x86_64, Mariusz Kozlowski, (Tue Aug 5, 4:29 pm)
Re: 2.6.27-rc1-mm1: sparc64 BUG: using smp_processor_id() in..., Mariusz Kozlowski, (Sat Aug 2, 11:17 am)
Re: 2.6.27-rc1-mm1: sparc64 BUG: using smp_processor_id() in..., David Miller, (Sun Aug 3, 3:02 am)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Mariusz Kozlowski, (Sat Aug 2, 5:23 am)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Bartlomiej Zolnierkiewicz..., (Sat Aug 2, 12:15 pm)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Mariusz Kozlowski, (Sat Aug 2, 7:25 pm)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Bartlomiej Zolnierkiewicz..., (Sun Aug 3, 10:41 am)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Mariusz Kozlowski, (Sun Aug 3, 11:45 am)
Re: [BUILD-FAILURE] 2.6.27-rc1-mm1 - allyesconfig build fail..., Peter 1 Oberparleiter, (Fri Aug 1, 11:44 am)
Re: [BUILD-FAILURE] 2.6.27-rc1-mm1 - allyesconfig build fail..., Peter 1 Oberparleiter, (Fri Aug 1, 11:40 am)
2.6.27-rc1-mm1: busyloop time-schedule, Alexey Dobriyan, (Thu Jul 31, 8:23 am)
Re: 2.6.27-rc1-mm1, Balbir Singh, (Thu Jul 31, 4:10 am)