Skip to contentSkip to conversation

traces.

2.5.66-mm3+debug Andrew Morton 2 participants 4 messages Apr 5, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Dave,

Ian was hitting the BUG in local_bh_enable(). The call trace is below.

This patch fixes it up:

drivers/net/tulip/dmfe.c renamed from drivers/net/tulip/dmfe.c~dmfe-kfree_skb-fix +3 -3
diff -puN drivers/net/tulip/dmfe.c~dmfe-kfree_skb-fix drivers/net/tulip/dmfe.c
@@ -668,13 +668,13 @@ static int dmfe_start_xmit(struct sk_buf
 	if ( db->tx_queue_cnt < TX_FREE_DESC_CNT )
 		netif_wake_queue(dev);
 
-	/* free this SKB */
-	dev_kfree_skb(skb);
-
 	/* Restore CR7 to enable interrupt */
 	spin_unlock_irqrestore(&db->lock, flags);
 	outl(db->cr7_data, dev->base_addr + DCR7);
 
+	/* free this SKB */
+	dev_kfree_skb(skb);
+
 	return 0;
 }
 

_

It is a bit worrisome that dev_kfree_skb() is now illegal if local interrupts are disabled. I'd expect there to be more instances.

Begin forwarded message:

Date: 05 Apr 2003 02:28:30 +0200
From: Ian Kumlien <[email protected]>
To: Andrew Morton <[email protected]>
Subject: [2.5.66-mm3+debug] traces.

Hi,

I'm currently to tired to proof read these to see if they are the same or not... i think they are... And i don't trust 2.5.x's makesystem to keep track any more =)

Anyways, I added em all to this mail, i HOPE that you have no limitations on your mail account and so on. I also hope that your on a dsl or simular connection =).

btw, it seems to happen on every nfs access. I'll explore the possibilities of using the pure tulip network driver tomorrow...

irqs are enabled

Call Trace:
 [<c011f424>] local_bh_enable+0x74/0x80
 [<c038ba8a>] svc_write_space+0x2a/0x90
 [<c030d309>] __kfree_skb+0x69/0xf0
 [<c030c3b9>] sock_wfree+0x49/0x50
 [<c030c370>] sock_wfree+0x0/0x50
 [<c030d2fd>] __kfree_skb+0x5d/0xf0
 [<c0244010>] dmfe_start_xmit+0x150/0x240
 [<c0310c2d>] dev_queue_xmit_nit+0x9d/0xf0
 [<c0318195>] qdisc_restart+0x65/0x140
 [<c0310f10>] dev_queue_xmit+0x200/0x2b0
 [<c0321ee9>] ip_output+0x109/0x220
 [<c0323ae6>] ip_push_pending_frames+0x296/0x380
 [<c034020d>] udp_push_pending_frames+0xfd/0x210
 [<c03405ad>] udp_sendmsg+0x24d/0x880
 [<c0323384>] ip_append_data+0x664/0x750
 [<c031dd6d>] __ip_route_output_key+0x2d/0xf0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c03097de>] sock_sendmsg+0x9e/0xd0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c030caf4>] sock_no_sendpage+0xa4/0xb0
 [<c0340d81>] udp_sendpage+0x1a1/0x2c0
 [<c0348ed7>] inet_sendpage+0x67/0xd0
 [<c038b6a1>] svc_sendto+0xb1/0x270
 [<c038be81>] svc_udp_sendto+0x21/0x40
 [<c038d288>] svc_send+0x78/0xf0
 [<c038efd8>] svcauth_unix_release+0x38/0x40
 [<c01ac180>] nfsd_dispatch+0x0/0x1f0
 [<c038ac0c>] svc_process+0x1fc/0x680
 [<c01abfe9>] nfsd+0x1b9/0x350
 [<c01abe30>] nfsd+0x0/0x350
 [<c010706d>] kernel_thread_helper+0x5/0x18

irqs are enabled

Call Trace:
 [<c011f424>] local_bh_enable+0x74/0x80
 [<c038ba8a>] svc_write_space+0x2a/0x90
 [<c030d309>] __kfree_skb+0x69/0xf0
 [<c030c3b9>] sock_wfree+0x49/0x50
 [<c030c370>] sock_wfree+0x0/0x50
 [<c030d2fd>] __kfree_skb+0x5d/0xf0
 [<c0244010>] dmfe_start_xmit+0x150/0x240
 [<c0310c2d>] dev_queue_xmit_nit+0x9d/0xf0
 [<c0318195>] qdisc_restart+0x65/0x140
 [<c0310f10>] dev_queue_xmit+0x200/0x2b0
 [<c0321ee9>] ip_output+0x109/0x220
 [<c0323ae6>] ip_push_pending_frames+0x296/0x380
 [<c034020d>] udp_push_pending_frames+0xfd/0x210
 [<c03405ad>] udp_sendmsg+0x24d/0x880
 [<c0323384>] ip_append_data+0x664/0x750
 [<c031dd6d>] __ip_route_output_key+0x2d/0xf0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c03097de>] sock_sendmsg+0x9e/0xd0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c030caf4>] sock_no_sendpage+0xa4/0xb0
 [<c0340d81>] udp_sendpage+0x1a1/0x2c0
 [<c0348ed7>] inet_sendpage+0x67/0xd0
 [<c038b6a1>] svc_sendto+0xb1/0x270
 [<c038be81>] svc_udp_sendto+0x21/0x40
 [<c038d288>] svc_send+0x78/0xf0
 [<c038efd8>] svcauth_unix_release+0x38/0x40
 [<c01ac180>] nfsd_dispatch+0x0/0x1f0
 [<c038ac0c>] svc_process+0x1fc/0x680
 [<c01abfe9>] nfsd+0x1b9/0x350
 [<c01abe30>] nfsd+0x0/0x350
 [<c010706d>] kernel_thread_helper+0x5/0x18

irqs are enabled

Call Trace:
 [<c011f424>] local_bh_enable+0x74/0x80
 [<c038ba8a>] svc_write_space+0x2a/0x90
 [<c030d309>] __kfree_skb+0x69/0xf0
 [<c030c3b9>] sock_wfree+0x49/0x50
 [<c030c370>] sock_wfree+0x0/0x50
 [<c030d2fd>] __kfree_skb+0x5d/0xf0
 [<c0244010>] dmfe_start_xmit+0x150/0x240
 [<c0310c2d>] dev_queue_xmit_nit+0x9d/0xf0
 [<c0318195>] qdisc_restart+0x65/0x140
 [<c0310f10>] dev_queue_xmit+0x200/0x2b0
 [<c0321ee9>] ip_output+0x109/0x220
 [<c0323ae6>] ip_push_pending_frames+0x296/0x380
 [<c034020d>] udp_push_pending_frames+0xfd/0x210
 [<c03405ad>] udp_sendmsg+0x24d/0x880
 [<c0323384>] ip_append_data+0x664/0x750
 [<c031dd6d>] __ip_route_output_key+0x2d/0xf0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c03097de>] sock_sendmsg+0x9e/0xd0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c030caf4>] sock_no_sendpage+0xa4/0xb0
 [<c0340d81>] udp_sendpage+0x1a1/0x2c0
 [<c0348ed7>] inet_sendpage+0x67/0xd0
 [<c038b6a1>] svc_sendto+0xb1/0x270
 [<c038be81>] svc_udp_sendto+0x21/0x40
 [<c038d288>] svc_send+0x78/0xf0
 [<c038efd8>] svcauth_unix_release+0x38/0x40
 [<c01ac180>] nfsd_dispatch+0x0/0x1f0
 [<c038ac0c>] svc_process+0x1fc/0x680
 [<c01abfe9>] nfsd+0x1b9/0x350
 [<c01abe30>] nfsd+0x0/0x350
 [<c010706d>] kernel_thread_helper+0x5/0x18

irqs are enabled

Call Trace:
 [<c011f424>] local_bh_enable+0x74/0x80
 [<c038ba8a>] svc_write_space+0x2a/0x90
 [<c030d309>] __kfree_skb+0x69/0xf0
 [<c030c3b9>] sock_wfree+0x49/0x50
 [<c030c370>] sock_wfree+0x0/0x50
 [<c030d2fd>] __kfree_skb+0x5d/0xf0
 [<c0244010>] dmfe_start_xmit+0x150/0x240
 [<c0310c2d>] dev_queue_xmit_nit+0x9d/0xf0
 [<c0318195>] qdisc_restart+0x65/0x140
 [<c0310f10>] dev_queue_xmit+0x200/0x2b0
 [<c0321ee9>] ip_output+0x109/0x220
 [<c0323ae6>] ip_push_pending_frames+0x296/0x380
 [<c034020d>] udp_push_pending_frames+0xfd/0x210
 [<c03405ad>] udp_sendmsg+0x24d/0x880
 [<c0323384>] ip_append_data+0x664/0x750
 [<c031dd6d>] __ip_route_output_key+0x2d/0xf0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c03097de>] sock_sendmsg+0x9e/0xd0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c030caf4>] sock_no_sendpage+0xa4/0xb0
 [<c0340d81>] udp_sendpage+0x1a1/0x2c0
 [<c0348ed7>] inet_sendpage+0x67/0xd0
 [<c038b6a1>] svc_sendto+0xb1/0x270
 [<c038be81>] svc_udp_sendto+0x21/0x40
 [<c038d288>] svc_send+0x78/0xf0
 [<c038efd8>] svcauth_unix_release+0x38/0x40
 [<c01ac180>] nfsd_dispatch+0x0/0x1f0
 [<c038ac0c>] svc_process+0x1fc/0x680
 [<c01abfe9>] nfsd+0x1b9/0x350
 [<c01abe30>] nfsd+0x0/0x350
 [<c010706d>] kernel_thread_helper+0x5/0x18

irqs are enabled

Call Trace:
 [<c011f424>] local_bh_enable+0x74/0x80
 [<c038ba8a>] svc_write_space+0x2a/0x90
 [<c030d309>] __kfree_skb+0x69/0xf0
 [<c030c3b9>] sock_wfree+0x49/0x50
 [<c030c370>] sock_wfree+0x0/0x50
 [<c030d2fd>] __kfree_skb+0x5d/0xf0
 [<c0244010>] dmfe_start_xmit+0x150/0x240
 [<c0310c2d>] dev_queue_xmit_nit+0x9d/0xf0
 [<c0318195>] qdisc_restart+0x65/0x140
 [<c0310f10>] dev_queue_xmit+0x200/0x2b0
 [<c0321ee9>] ip_output+0x109/0x220
 [<c0323ae6>] ip_push_pending_frames+0x296/0x380
 [<c034020d>] udp_push_pending_frames+0xfd/0x210
 [<c03405ad>] udp_sendmsg+0x24d/0x880
 [<c0323384>] ip_append_data+0x664/0x750
 [<c031dd6d>] __ip_route_output_key+0x2d/0xf0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c03097de>] sock_sendmsg+0x9e/0xd0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c030caf4>] sock_no_sendpage+0xa4/0xb0
 [<c0340d81>] udp_sendpage+0x1a1/0x2c0
 [<c0348ed7>] inet_sendpage+0x67/0xd0
 [<c038b6a1>] svc_sendto+0xb1/0x270
 [<c038be81>] svc_udp_sendto+0x21/0x40
 [<c038d288>] svc_send+0x78/0xf0
 [<c038efd8>] svcauth_unix_release+0x38/0x40
 [<c01ac180>] nfsd_dispatch+0x0/0x1f0
 [<c038ac0c>] svc_process+0x1fc/0x680
 [<c01abfe9>] nfsd+0x1b9/0x350
 [<c01abe30>] nfsd+0x0/0x350
 [<c010706d>] kernel_thread_helper+0x5/0x18

irqs are enabled

Call Trace:
 [<c011f424>] local_bh_enable+0x74/0x80
 [<c038ba8a>] svc_write_space+0x2a/0x90
 [<c030d309>] __kfree_skb+0x69/0xf0
 [<c030c3b9>] sock_wfree+0x49/0x50
 [<c030c370>] sock_wfree+0x0/0x50
 [<c030d2fd>] __kfree_skb+0x5d/0xf0
 [<c0244010>] dmfe_start_xmit+0x150/0x240
 [<c0310c2d>] dev_queue_xmit_nit+0x9d/0xf0
 [<c0318195>] qdisc_restart+0x65/0x140
 [<c0310f10>] dev_queue_xmit+0x200/0x2b0
 [<c0321ee9>] ip_output+0x109/0x220
 [<c0323ae6>] ip_push_pending_frames+0x296/0x380
 [<c034020d>] udp_push_pending_frames+0xfd/0x210
 [<c03405ad>] udp_sendmsg+0x24d/0x880
 [<c0323384>] ip_append_data+0x664/0x750
 [<c031dd6d>] __ip_route_output_key+0x2d/0xf0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c03097de>] sock_sendmsg+0x9e/0xd0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c030caf4>] sock_no_sendpage+0xa4/0xb0
 [<c0340d81>] udp_sendpage+0x1a1/0x2c0
 [<c0348ed7>] inet_sendpage+0x67/0xd0
 [<c038b6a1>] svc_sendto+0xb1/0x270
 [<c038be81>] svc_udp_sendto+0x21/0x40
 [<c038d288>] svc_send+0x78/0xf0
 [<c038efd8>] svcauth_unix_release+0x38/0x40
 [<c01ac180>] nfsd_dispatch+0x0/0x1f0
 [<c038ac0c>] svc_process+0x1fc/0x680
 [<c01abfe9>] nfsd+0x1b9/0x350
 [<c01abe30>] nfsd+0x0/0x350
 [<c010706d>] kernel_thread_helper+0x5/0x18

irqs are enabled

Call Trace:
 [<c011f424>] local_bh_enable+0x74/0x80
 [<c038ba8a>] svc_write_space+0x2a/0x90
 [<c030d309>] __kfree_skb+0x69/0xf0
 [<c012dab0>] nanosleep_wake_up+0x0/0x10
 [<c030c3b9>] sock_wfree+0x49/0x50
 [<c030c370>] sock_wfree+0x0/0x50
 [<c030d2fd>] __kfree_skb+0x5d/0xf0
 [<c0244010>] dmfe_start_xmit+0x150/0x240
 [<c0310c2d>] dev_queue_xmit_nit+0x9d/0xf0
 [<c0318195>] qdisc_restart+0x65/0x140
 [<c0310f10>] dev_queue_xmit+0x200/0x2b0
 [<c0321ee9>] ip_output+0x109/0x220
 [<c0323ae6>] ip_push_pending_frames+0x296/0x380
 [<c034020d>] udp_push_pending_frames+0xfd/0x210
 [<c03405ad>] udp_sendmsg+0x24d/0x880
 [<c0323384>] ip_append_data+0x664/0x750
 [<c031dd6d>] __ip_route_output_key+0x2d/0xf0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c03097de>] sock_sendmsg+0x9e/0xd0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c030caf4>] sock_no_sendpage+0xa4/0xb0
 [<c0340d81>] udp_sendpage+0x1a1/0x2c0
 [<c0348ed7>] inet_sendpage+0x67/0xd0
 [<c038b6a1>] svc_sendto+0xb1/0x270
 [<c038be81>] svc_udp_sendto+0x21/0x40
 [<c038d288>] svc_send+0x78/0xf0
 [<c038efd8>] svcauth_unix_release+0x38/0x40
 [<c01ac180>] nfsd_dispatch+0x0/0x1f0
 [<c038ac0c>] svc_process+0x1fc/0x680
 [<c01abfe9>] nfsd+0x1b9/0x350
 [<c01abe30>] nfsd+0x0/0x350
 [<c010706d>] kernel_thread_helper+0x5/0x18

irqs are enabled

Call Trace:
 [<c011f424>] local_bh_enable+0x74/0x80
 [<c038ba8a>] svc_write_space+0x2a/0x90
 [<c030d309>] __kfree_skb+0x69/0xf0
 [<c030c3b9>] sock_wfree+0x49/0x50
 [<c030c370>] sock_wfree+0x0/0x50
 [<c030d2fd>] __kfree_skb+0x5d/0xf0
 [<c0244010>] dmfe_start_xmit+0x150/0x240
 [<c0310c2d>] dev_queue_xmit_nit+0x9d/0xf0
 [<c0318195>] qdisc_restart+0x65/0x140
 [<c0310f10>] dev_queue_xmit+0x200/0x2b0
 [<c0321ee9>] ip_output+0x109/0x220
 [<c0323ae6>] ip_push_pending_frames+0x296/0x380
 [<c034020d>] udp_push_pending_frames+0xfd/0x210
 [<c03405ad>] udp_sendmsg+0x24d/0x880
 [<c0323384>] ip_append_data+0x664/0x750
 [<c031dd6d>] __ip_route_output_key+0x2d/0xf0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c03097de>] sock_sendmsg+0x9e/0xd0
 [<c0348e5d>] inet_sendmsg+0x4d/0x60
 [<c030caf4>] sock_no_sendpage+0xa4/0xb0
 [<c0340d81>] udp_sendpage+0x1a1/0x2c0
 [<c0348ed7>] inet_sendpage+0x67/0xd0
 [<c038b6a1>] svc_sendto+0xb1/0x270
 [<c038be81>] svc_udp_sendto+0x21/0x40
 [<c038d288>] svc_send+0x78/0xf0
 [<c038efd8>] svcauth_unix_release+0x38/0x40
 [<c01ac180>] nfsd_dispatch+0x0/0x1f0
 [<c038ac0c>] svc_process+0x1fc/0x680
 [<c01abfe9>] nfsd+0x1b9/0x350
 [<c01abe30>] nfsd+0x0/0x350
 [<c010706d>] kernel_thread_helper+0x5/0x18
Signature · 1 line
Ian Kumlien <[email protected]>
#1 lore raw

From: Andrew Morton <[email protected]>
Date: Fri, 4 Apr 2003 17:29:27 -0800

It is a bit worrisome that dev_kfree_skb() is now illegal if local interrupts are disabled. I'd expect there to be more instances.

Why worrisome? It's an error, and now at least we'll know about it. This isn't a "is now illegal", it's always been illegal. You simply cannot take BH locks inside of IRQ disabling ones, this is true 2.4.x too it just doesn't BUG() on you there (you get a potential deadlock instead).

This patch should go through the Tulip maintainer (Jeff I guess) especially since it's a fix that belongs in 2.4.x as well.

Thanks Andrew.

#2 lore raw
Quoted 4 lines · David S. Miller

You simply cannot take BH locks inside of IRQ disabling ones, this is true 2.4.x too it just doesn't BUG() on you there (you get a potential deadlock instead).

I don't recall seeing a description or discussion of this deadlock. Any pointers?

Quoted 2 lines

This patch should go through the Tulip maintainer (Jeff I guess) especially since it's a fix that belongs in 2.4.x as well.

Yup, I'll spam Jeff.

#3 lore raw

From: Andrew Morton <[email protected]>
Date: Fri, 4 Apr 2003 18:14:27 -0800

Quoted 4 lines · David S. Miller

You simply cannot take BH locks inside of IRQ disabling ones, this is true 2.4.x too it just doesn't BUG() on you there (you get a potential deadlock instead).

I don't recall seeing a description or discussion of this deadlock. Any pointers?

Search the archives for the subject "BUG or not? GFP_KERNEL with interrupts disabled." unfortunately it appears a lot of that thread got privatized and I don't have any logs.

The long and short of it is:

	spin_lock_irq();

		anything which does local_bh_{enable,disable}()

	spin_unlock_irq();

and similar are illegal.

local_bh_enable() invokes do_softirq() if softints are pending, do_softirq() enables cpu interrupts, which would result in a deadlock in the above case (because an interrupt could arrive and try to take the IRQ spinlock taken by spin_lock_irq()).

Therefore it's a bug, and it's a bug everywhere BUG() check or not. :-)