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: Andrew Morton <akpm@...>, <davem@...>
Cc: <linux-kernel@...>, <kernel-testers@...>, <sparclinux@...>
Date: Saturday, August 2, 2008 - 11:17 am

Hello,

$ uname -a
Linux sparc64 2.6.27-rc1-mm1 #1 SMP PREEMPT Sat Aug 2 15:51:55 CEST 2008 sparc64 sun4u TI UltraSparc II (BlackBird) GNU/Linux

Logs get a little flooded with:

BUG: using smp_processor_id() in preemptible [00000000] code: emerge/3217
caller is smp_call_function_mask+0x1c/0x180
Call Trace:
 [0000000000486374] smp_call_function_mask+0x14/0x180
 [0000000000447f94] tsb_grow+0x2d4/0x420
 [000000000040796c] sparc64_realfault_common+0x10/0x20
 [000000000045b604] schedule_tail+0x64/0xa0
 [0000000000406150] ret_from_syscall+0x8/0x48
BUG: using smp_processor_id() in preemptible [00000000] code: emerge/3220
caller is smp_call_function_mask+0x1c/0x180
Call Trace:
 [0000000000486374] smp_call_function_mask+0x14/0x180
 [0000000000447f94] tsb_grow+0x2d4/0x420
 [000000000040796c] sparc64_realfault_common+0x10/0x20
 [000000000045b604] schedule_tail+0x64/0xa0
 [0000000000406150] ret_from_syscall+0x8/0x48
BUG: using smp_processor_id() in preemptible [00000000] code: rsync/3220
caller is smp_call_function_mask+0x1c/0x180
Call Trace:
 [0000000000486374] smp_call_function_mask+0x14/0x180
 [0000000000447f94] tsb_grow+0x2d4/0x420
 [000000000040796c] sparc64_realfault_common+0x10/0x20
BUG: using smp_processor_id() in preemptible [00000000] code: rsync/3220
caller is smp_call_function_mask+0x1c/0x180
Call Trace:
 [0000000000486374] smp_call_function_mask+0x14/0x180
 [0000000000447f94] tsb_grow+0x2d4/0x420
 [000000000040796c] sparc64_realfault_common+0x10/0x20
BUG: using smp_processor_id() in preemptible [00000000] code: rsync/3224
caller is smp_call_function_mask+0x1c/0x180
Call Trace:
 [0000000000486374] smp_call_function_mask+0x14/0x180
 [0000000000447f94] tsb_grow+0x2d4/0x420
 [000000000040796c] sparc64_realfault_common+0x10/0x20
 [000000000045b604] schedule_tail+0x64/0xa0
 [0000000000406150] ret_from_syscall+0x8/0x48
BUG: using smp_processor_id() in preemptible [00000000] code: file/3246
caller is smp_call_function_mask+0x1c/0x180
Call Trace:
 [0000000000486374] smp_call_function_mask+0x14/0x180
 [0000000000447f94] tsb_grow+0x2d4/0x420
 [000000000040796c] sparc64_realfault_common+0x10/0x20

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>

--- linux-2.6.27-rc1-mm1/arch/sparc64/kernel/smp.c	2008-07-29 04:40:31.000000000 +0200
+++ linux-2.6.27-rc1-mm1-dirty/arch/sparc64/kernel/smp.c	2008-08-02 16:40:23.000000000 +0200
@@ -837,7 +837,9 @@ static void tsb_sync(void *info)
 
 void smp_tsb_sync(struct mm_struct *mm)
 {
+	preempt_disable();
 	smp_call_function_mask(mm->cpu_vm_mask, tsb_sync, mm, 1);
+	preempt_enable();
 }


	Mariusz
--
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: 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)