Files
odroid-linux/include/linux
Eric Dumazet 23d3b8bfb8 net: qdisc busylock needs lockdep annotations
It seems we need to provide ability for stacked devices
to use specific lock_class_key for sch->busylock

We could instead default l2tpeth tx_queue_len to 0 (no qdisc), but
a user might use a qdisc anyway.

(So same fixes are probably needed on non LLTX stacked drivers)

Noticed while stressing L2TPV3 setup :

======================================================
 [ INFO: possible circular locking dependency detected ]
 3.6.0-rc3+ #788 Not tainted
 -------------------------------------------------------
 netperf/4660 is trying to acquire lock:
  (l2tpsock){+.-...}, at: [<ffffffffa0208db2>] l2tp_xmit_skb+0x172/0xa50 [l2tp_core]

 but task is already holding lock:
  (&(&sch->busylock)->rlock){+.-...}, at: [<ffffffff81596595>] dev_queue_xmit+0xd75/0xe00

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -> #1 (&(&sch->busylock)->rlock){+.-...}:
        [<ffffffff810a5df0>] lock_acquire+0x90/0x200
        [<ffffffff817499fc>] _raw_spin_lock_irqsave+0x4c/0x60
        [<ffffffff81074872>] __wake_up+0x32/0x70
        [<ffffffff8136d39e>] tty_wakeup+0x3e/0x80
        [<ffffffff81378fb3>] pty_write+0x73/0x80
        [<ffffffff8136cb4c>] tty_put_char+0x3c/0x40
        [<ffffffff813722b2>] process_echoes+0x142/0x330
        [<ffffffff813742ab>] n_tty_receive_buf+0x8fb/0x1230
        [<ffffffff813777b2>] flush_to_ldisc+0x142/0x1c0
        [<ffffffff81062818>] process_one_work+0x198/0x760
        [<ffffffff81063236>] worker_thread+0x186/0x4b0
        [<ffffffff810694d3>] kthread+0x93/0xa0
        [<ffffffff81753e24>] kernel_thread_helper+0x4/0x10

 -> #0 (l2tpsock){+.-...}:
        [<ffffffff810a5288>] __lock_acquire+0x1628/0x1b10
        [<ffffffff810a5df0>] lock_acquire+0x90/0x200
        [<ffffffff817498c1>] _raw_spin_lock+0x41/0x50
        [<ffffffffa0208db2>] l2tp_xmit_skb+0x172/0xa50 [l2tp_core]
        [<ffffffffa021a802>] l2tp_eth_dev_xmit+0x32/0x60 [l2tp_eth]
        [<ffffffff815952b2>] dev_hard_start_xmit+0x502/0xa70
        [<ffffffff815b63ce>] sch_direct_xmit+0xfe/0x290
        [<ffffffff81595a05>] dev_queue_xmit+0x1e5/0xe00
        [<ffffffff815d9d60>] ip_finish_output+0x3d0/0x890
        [<ffffffff815db019>] ip_output+0x59/0xf0
        [<ffffffff815da36d>] ip_local_out+0x2d/0xa0
        [<ffffffff815da5a3>] ip_queue_xmit+0x1c3/0x680
        [<ffffffff815f4192>] tcp_transmit_skb+0x402/0xa60
        [<ffffffff815f4a94>] tcp_write_xmit+0x1f4/0xa30
        [<ffffffff815f5300>] tcp_push_one+0x30/0x40
        [<ffffffff815e6672>] tcp_sendmsg+0xe82/0x1040
        [<ffffffff81614495>] inet_sendmsg+0x125/0x230
        [<ffffffff81576cdc>] sock_sendmsg+0xdc/0xf0
        [<ffffffff81579ece>] sys_sendto+0xfe/0x130
        [<ffffffff81752c92>] system_call_fastpath+0x16/0x1b
  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&(&sch->busylock)->rlock);
                                lock(l2tpsock);
                                lock(&(&sch->busylock)->rlock);
   lock(l2tpsock);

  *** DEADLOCK ***

 5 locks held by netperf/4660:
  #0:  (sk_lock-AF_INET){+.+.+.}, at: [<ffffffff815e581c>] tcp_sendmsg+0x2c/0x1040
  #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff815da3e0>] ip_queue_xmit+0x0/0x680
  #2:  (rcu_read_lock_bh){.+....}, at: [<ffffffff815d9ac5>] ip_finish_output+0x135/0x890
  #3:  (rcu_read_lock_bh){.+....}, at: [<ffffffff81595820>] dev_queue_xmit+0x0/0xe00
  #4:  (&(&sch->busylock)->rlock){+.-...}, at: [<ffffffff81596595>] dev_queue_xmit+0xd75/0xe00

 stack backtrace:
 Pid: 4660, comm: netperf Not tainted 3.6.0-rc3+ #788
 Call Trace:
  [<ffffffff8173dbf8>] print_circular_bug+0x1fb/0x20c
  [<ffffffff810a5288>] __lock_acquire+0x1628/0x1b10
  [<ffffffff810a334b>] ? check_usage+0x9b/0x4d0
  [<ffffffff810a3f44>] ? __lock_acquire+0x2e4/0x1b10
  [<ffffffff810a5df0>] lock_acquire+0x90/0x200
  [<ffffffffa0208db2>] ? l2tp_xmit_skb+0x172/0xa50 [l2tp_core]
  [<ffffffff817498c1>] _raw_spin_lock+0x41/0x50
  [<ffffffffa0208db2>] ? l2tp_xmit_skb+0x172/0xa50 [l2tp_core]
  [<ffffffffa0208db2>] l2tp_xmit_skb+0x172/0xa50 [l2tp_core]
  [<ffffffffa021a802>] l2tp_eth_dev_xmit+0x32/0x60 [l2tp_eth]
  [<ffffffff815952b2>] dev_hard_start_xmit+0x502/0xa70
  [<ffffffff81594e0e>] ? dev_hard_start_xmit+0x5e/0xa70
  [<ffffffff81595961>] ? dev_queue_xmit+0x141/0xe00
  [<ffffffff815b63ce>] sch_direct_xmit+0xfe/0x290
  [<ffffffff81595a05>] dev_queue_xmit+0x1e5/0xe00
  [<ffffffff81595820>] ? dev_hard_start_xmit+0xa70/0xa70
  [<ffffffff815d9d60>] ip_finish_output+0x3d0/0x890
  [<ffffffff815d9ac5>] ? ip_finish_output+0x135/0x890
  [<ffffffff815db019>] ip_output+0x59/0xf0
  [<ffffffff815da36d>] ip_local_out+0x2d/0xa0
  [<ffffffff815da5a3>] ip_queue_xmit+0x1c3/0x680
  [<ffffffff815da3e0>] ? ip_local_out+0xa0/0xa0
  [<ffffffff815f4192>] tcp_transmit_skb+0x402/0xa60
  [<ffffffff815fa25e>] ? tcp_md5_do_lookup+0x18e/0x1a0
  [<ffffffff815f4a94>] tcp_write_xmit+0x1f4/0xa30
  [<ffffffff815f5300>] tcp_push_one+0x30/0x40
  [<ffffffff815e6672>] tcp_sendmsg+0xe82/0x1040
  [<ffffffff81614495>] inet_sendmsg+0x125/0x230
  [<ffffffff81614370>] ? inet_create+0x6b0/0x6b0
  [<ffffffff8157e6e2>] ? sock_update_classid+0xc2/0x3b0
  [<ffffffff8157e750>] ? sock_update_classid+0x130/0x3b0
  [<ffffffff81576cdc>] sock_sendmsg+0xdc/0xf0
  [<ffffffff81162579>] ? fget_light+0x3f9/0x4f0
  [<ffffffff81579ece>] sys_sendto+0xfe/0x130
  [<ffffffff810a69ad>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffff8174a0b0>] ? _raw_spin_unlock_irq+0x30/0x50
  [<ffffffff810757e3>] ? finish_task_switch+0x83/0xf0
  [<ffffffff810757a6>] ? finish_task_switch+0x46/0xf0
  [<ffffffff81752cb7>] ? sysret_check+0x1b/0x56
  [<ffffffff81752c92>] system_call_fastpath+0x16/0x1b

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-05 17:49:27 -04:00
..
2012-07-30 18:16:01 -07:00
2012-07-30 18:15:23 -07:00
2011-03-31 11:26:23 -03:00
2012-04-23 14:23:32 +03:00
2011-03-31 11:26:23 -03:00
2012-05-15 17:30:30 -04:00
2012-08-10 15:27:02 -04:00
2010-10-15 21:18:59 +02:00
2011-07-22 08:25:37 -07:00
2010-11-23 20:14:46 +00:00
2012-07-30 17:25:21 -07:00
2011-07-20 20:47:43 -04:00
2012-06-29 11:38:17 -04:00
2011-10-26 15:43:25 -04:00
2011-01-15 20:07:45 -05:00
2011-03-22 17:43:59 -07:00
2011-03-11 14:25:50 +00:00
2012-03-20 21:29:46 -04:00
2011-08-03 11:30:42 -04:00
2011-07-26 16:49:47 -07:00
2012-08-07 10:10:57 +02:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2012-07-31 18:42:43 -07:00
2012-06-06 19:12:30 -07:00
2012-07-30 17:25:11 -07:00
2011-03-31 11:26:23 -03:00
2010-10-25 08:02:40 -07:00
2012-02-28 16:02:54 +01:00
2012-01-03 22:54:57 -05:00
2011-10-29 21:20:22 +02:00
2011-03-31 11:26:23 -03:00
2012-03-23 16:58:38 -07:00
2011-07-25 20:57:16 -07:00
2011-12-13 09:26:45 +00:00
2012-04-14 15:24:26 -04:00
2011-01-10 08:51:44 -08:00
2012-02-20 19:46:36 +11:00
2011-05-23 10:47:06 -05:00
2012-05-02 14:15:27 -05:00
2011-05-29 13:03:09 +01:00
2012-05-25 12:46:23 +05:30
2012-05-10 12:00:56 +02:00
2011-11-26 14:59:39 -05:00
2011-12-11 18:25:16 -05:00
2012-08-21 01:19:54 -07:00
2011-09-14 15:24:51 -04:00
2012-05-29 23:28:33 -04:00
2011-01-12 20:16:43 -05:00
2011-03-14 19:12:20 -04:00
2012-07-22 23:57:58 +04:00
2011-01-10 08:51:44 -08:00
2011-01-07 17:50:27 +11:00
2012-08-04 01:24:44 +04:00
2010-10-25 14:11:37 -07:00
2012-04-27 10:46:45 +08:00
2012-07-05 15:04:10 +02:00
2011-07-01 15:34:45 -07:00
2012-08-09 16:18:06 -07:00
2011-03-31 11:26:23 -03:00
2010-10-12 16:53:37 +02:00
2012-03-26 21:47:19 +02:00
2012-03-26 21:47:19 +02:00
2012-03-26 21:47:19 +02:00
2012-05-12 14:28:14 +02:00
2012-03-26 21:47:19 +02:00
2011-02-23 00:53:26 +00:00
2011-07-01 10:37:15 +02:00
2012-07-02 15:11:12 +02:00
2012-08-14 14:28:32 -07:00
2012-03-27 22:45:26 -04:00
2012-08-14 14:28:32 -07:00
2011-07-21 13:47:54 -07:00
2012-03-20 12:47:48 +01:00
2012-05-07 10:58:57 -06:00
2012-03-20 12:47:47 +01:00
2012-08-14 14:28:32 -07:00
2012-01-03 22:55:17 -05:00
2012-07-19 10:38:32 -04:00
2010-10-07 14:08:55 +01:00
2012-04-09 11:16:55 -07:00
2011-03-31 11:26:23 -03:00
2010-12-09 20:17:07 -08:00
2012-03-08 10:50:35 -08:00
2012-05-31 17:49:32 -07:00
2011-02-17 11:12:40 -08:00
2012-07-31 08:16:42 -05:00
2012-05-31 17:49:30 -07:00
2012-03-08 10:50:35 -08:00
2012-05-11 10:56:56 +01:00
2011-01-13 17:32:47 -08:00
2011-01-24 14:45:11 +10:30
2012-08-22 10:24:41 -04:00
2011-03-31 11:26:23 -03:00
2011-12-27 11:26:41 +02:00
2011-09-16 19:20:20 -04:00
2012-05-29 23:28:41 -04:00
2011-04-25 18:14:10 -07:00
2012-03-15 21:41:34 +01:00
2012-05-09 13:58:06 -07:00
2012-05-22 15:20:28 -04:00
2011-07-26 16:49:47 -07:00
2011-07-26 16:49:47 -07:00
2012-07-29 21:24:13 +04:00
2012-07-09 16:42:24 -04:00
2012-05-26 14:17:30 -04:00
2012-07-30 19:06:52 -04:00
2012-07-30 19:06:52 -04:00
2012-08-20 13:58:21 +02:00
2012-07-10 10:32:06 -05:00
2012-05-21 14:31:48 +01:00
2012-07-31 18:42:43 -07:00
2012-06-20 14:39:36 -07:00
2011-01-16 13:47:07 -05:00
2012-08-30 13:14:48 -04:00
2012-01-06 12:10:26 -08:00
2012-05-14 14:15:32 -07:00
2011-05-26 17:12:37 -07:00
2012-07-12 07:54:46 -07:00
2012-05-12 15:53:42 -04:00
2011-12-13 09:26:45 +00:00
2011-11-02 16:07:02 -07:00
2011-01-13 08:03:21 -08:00
2011-03-31 11:26:23 -03:00
2012-06-15 12:56:57 +02:00
2012-03-20 21:29:38 -04:00
2012-01-03 22:55:07 -05:00
2012-07-19 10:38:32 -04:00
2011-01-14 02:36:43 +00:00
2012-08-21 20:50:25 +02:00
2012-03-28 18:30:03 +01:00
2012-07-30 17:25:20 -07:00
2012-06-01 12:58:52 -04:00
2012-07-02 13:40:06 +03:00
2011-03-31 11:26:23 -03:00
2012-06-05 17:32:30 +02:00
2012-07-16 22:31:34 -07:00
2011-07-26 16:49:47 -07:00
2011-12-13 09:26:45 +00:00
2012-06-13 21:16:42 +02:00
2011-08-16 00:16:49 -07:00
2010-11-29 08:55:25 +11:00
2010-11-29 08:55:22 +11:00
2012-07-22 23:57:55 +04:00
2012-06-18 13:42:03 +02:00
2011-11-02 16:07:02 -07:00
2012-07-31 08:16:24 -06:00
2012-05-22 12:16:16 +09:30
2012-07-31 18:42:50 -07:00
2012-03-28 18:30:03 +01:00
2011-03-31 11:26:23 -03:00
2012-08-04 12:15:37 +04:00
2011-09-14 15:24:51 -04:00
2011-03-31 11:26:23 -03:00
2011-01-13 08:03:24 -08:00