public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* tun.c patch to fix "smp_processor_id() in preemptible code"
@ 2004-10-15 21:43 Alain Schroeder
  2004-10-15 22:22 ` Herbert Xu
  2004-10-15 22:35 ` Lee Revell
  0 siblings, 2 replies; 13+ messages in thread
From: Alain Schroeder @ 2004-10-15 21:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jan-Benedict Glaw

[-- Attachment #1: Type: text/plain, Size: 781 bytes --]

I was getting these traces on a SMP host:

dsor-vm2 kernel: using smp_processor_id() in preemptible code: linux/480
dsor-vm2 kernel:  [smp_processor_id+108/132] smp_processor_id+0x6c/0x84
kernel:  [pg0+945156838/1070318592] tun_chr_writev+0x14e/0x174 [tun]
kernel:  [pg0+945156917/1070318592] tun_chr_write+0x29/0x30 [tun]
kernel:  [vfs_write+189/236] vfs_write+0xbd/0xec
kernel:  [sys_write+64/108] sys_write+0x40/0x6c
kernel:  [syscall_call+7/11] syscall_call+0x7/0xb

The (very) little attached patch fixes this.

Bye,
   Alain

PS: I am not subscribed to the lkml.

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there." -- Indira Gandhi

[-- Attachment #2: tun-preempt.patch --]
[-- Type: text/x-patch, Size: 358 bytes --]

--- linux-2.6.8-rc2/drivers/net/tun.c	Wed Jun 16 05:19:22 2004
+++ linux-2.6.9-rc4-mm1-skas/drivers/net/tun.c	Fri Oct 15 21:16:18 2004
@@ -207,7 +207,9 @@
 	if (tun->flags & TUN_NOCHECKSUM)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
  
+	preempt_disable();
 	netif_rx_ni(skb);
+	preempt_enable();
    
 	tun->stats.rx_packets++;
 	tun->stats.rx_bytes += len;

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-10-20 10:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-15 21:43 tun.c patch to fix "smp_processor_id() in preemptible code" Alain Schroeder
2004-10-15 22:22 ` Herbert Xu
2004-10-15 22:35 ` Lee Revell
     [not found]   ` <200410172314.38597.vda@port.imtp.ilyichevsk.odessa.ua>
2004-10-19 18:31     ` Lee Revell
2004-10-19 21:35       ` Herbert Xu
2004-10-19 21:51         ` Lee Revell
2004-10-19 21:54           ` Herbert Xu
2004-10-19 22:10             ` Lee Revell
2004-10-19 22:33               ` David S. Miller
2004-10-19 22:42                 ` Lee Revell
2004-10-19 22:42                   ` David S. Miller
2004-10-19 22:51                     ` Lee Revell
2004-10-20  0:44                       ` David S. Miller

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