From: David Miller <davem@davemloft.net>
To: m.kozlowski@tuxland.pl
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
kernel-testers@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: 2.6.27-rc1-mm1: sparc64 BUG: using smp_processor_id() in preemptible code
Date: Sun, 03 Aug 2008 00:02:32 -0700 (PDT) [thread overview]
Message-ID: <20080803.000232.215078646.davem@davemloft.net> (raw)
In-Reply-To: <200808021717.47971.m.kozlowski@tuxland.pl>
From: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Date: Sat, 2 Aug 2008 17:17:47 +0200
> I'm running preemtible kernel and have seen similar things before:
> http://marc.info/?l=linux-kernel&m=120652827627051&w=2 and it was fixed by disabling
> preemtpion in relevant sparc64 code paths. smp_call_function_mask() documentation
> says it must be called with preemption disabled.
>
> Here is a similar fix. Compile and run tested.
>
> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
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
next prev parent reply other threads:[~2008-08-03 7:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-31 7:03 2.6.27-rc1-mm1 Andrew Morton
2008-07-31 8:10 ` 2.6.27-rc1-mm1 Balbir Singh
2008-07-31 12:23 ` 2.6.27-rc1-mm1: busyloop time-schedule Alexey Dobriyan
2008-07-31 12:43 ` [BUILD-FAILURE] 2.6.27-rc1-mm1 - allyesconfig build fails on powerpc Kamalesh Babulal
2008-08-01 5:29 ` Tony Breeds
2008-08-01 6:12 ` Andrew Morton
2008-08-01 15:40 ` Peter 1 Oberparleiter
2008-08-01 16:45 ` Sam Ravnborg
2008-08-01 15:44 ` Peter 1 Oberparleiter
2008-08-01 16:16 ` Kamalesh Babulal
2008-07-31 18:20 ` 2.6.27-rc1-mm1 Randy Dunlap
2008-08-02 9:23 ` 2.6.27-rc1-mm1: rmmod ide-cd_mod oops Mariusz Kozlowski
2008-08-02 16:15 ` Bartlomiej Zolnierkiewicz
2008-08-02 23:25 ` Mariusz Kozlowski
2008-08-03 14:41 ` Bartlomiej Zolnierkiewicz
2008-08-03 15:45 ` Mariusz Kozlowski
2008-08-02 15:17 ` 2.6.27-rc1-mm1: sparc64 BUG: using smp_processor_id() in preemptible code Mariusz Kozlowski
2008-08-03 7:02 ` David Miller [this message]
2008-08-05 20:26 ` 2.6.27-rc1-mm1: unable to boot with gcov on x86_64 Mariusz Kozlowski
2008-08-05 20:29 ` Mariusz Kozlowski
2008-08-06 7:23 ` Peter Oberparleiter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080803.000232.215078646.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=kernel-testers@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.kozlowski@tuxland.pl \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome