Eric Dumazet
cb7cf8a33f
inet: Clean up inet_csk_wait_for_connect() vs. might_sleep()
I got the following trace with current net-next kernel :
[14723.885290] WARNING: CPU: 26 PID: 22658 at kernel/sched/core.c:7285 __might_sleep+0x89/0xa0()
[14723.885325] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffff810e8734>] prepare_to_wait_exclusive+0x34/0xa0
[14723.885355] CPU: 26 PID: 22658 Comm: netserver Not tainted 4.0.0-dbg-DEV #1379
[14723.885359] ffffffff81a223a8 ffff881fae9e7ca8 ffffffff81650b5d 0000000000000001
[14723.885364] ffff881fae9e7cf8 ffff881fae9e7ce8 ffffffff810a72e7 0000000000000000
[14723.885367] ffffffff81a57620 000000000000093a 0000000000000000 ffff881fae9e7e64
[14723.885371] Call Trace:
[14723.885377] [<ffffffff81650b5d>] dump_stack+0x4c/0x65
[14723.885382] [<ffffffff810a72e7>] warn_slowpath_common+0x97/0xe0
[14723.885386] [<ffffffff810a73e6>] warn_slowpath_fmt+0x46/0x50
[14723.885390] [<ffffffff810f4c5d>] ? trace_hardirqs_on_caller+0x10d/0x1d0
[14723.885393] [<ffffffff810e8734>] ? prepare_to_wait_exclusive+0x34/0xa0
[14723.885396] [<ffffffff810e8734>] ? prepare_to_wait_exclusive+0x34/0xa0
[14723.885399] [<ffffffff810ccdc9>] __might_sleep+0x89/0xa0
[14723.885403] [<ffffffff81581846>] lock_sock_nested+0x36/0xb0
[14723.885406] [<ffffffff815829a3>] ? release_sock+0x173/0x1c0
[14723.885411] [<ffffffff815ea1f7>] inet_csk_accept+0x157/0x2a0
[14723.885415] [<ffffffff810e8900>] ? abort_exclusive_wait+0xc0/0xc0
[14723.885419] [<ffffffff8161b96d>] inet_accept+0x2d/0x150
[14723.885424] [<ffffffff8157db6f>] SYSC_accept4+0xff/0x210
[14723.885428] [<ffffffff8165a451>] ? retint_swapgs+0xe/0x44
[14723.885431] [<ffffffff810f4c5d>] ? trace_hardirqs_on_caller+0x10d/0x1d0
[14723.885437] [<ffffffff81369c0e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[14723.885441] [<ffffffff8157ef40>] SyS_accept+0x10/0x20
[14723.885444] [<ffffffff81659872>] system_call_fastpath+0x12/0x17
[14723.885447] ---[ end trace ff74cd83355b1873 ]---
In commit 26cabd3125
Peter added a sched_annotate_sleep() in sk_wait_event()
Is the following patch needed as well ?
Alternative would be to use sk_wait_event() from inet_csk_wait_for_connect()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-17 15:03:54 -04:00
..
2014-12-05 12:43:04 +01:00
2015-01-21 16:28:45 +10:30
2015-01-23 17:51:15 -08:00
2014-11-24 04:28:48 -05:00
2014-12-09 16:29:03 -05:00
2014-11-24 04:28:48 -05:00
2015-01-07 22:17:11 +01:00
2015-02-03 09:02:12 +01:00
2015-03-14 19:12:38 -04:00
2015-03-15 22:19:17 -04:00
2015-03-09 10:22:24 +01:00
2015-02-19 14:14:42 -08:00
2015-03-12 00:09:55 -04:00
2014-11-16 14:50:52 -05:00
2014-12-10 22:41:55 -05:00
2015-02-23 15:28:50 -05:00
2015-02-17 10:37:39 -08:00
2015-01-02 15:46:41 -05:00
2015-03-01 13:40:23 -05:00
2015-01-18 01:03:45 -05:00
2015-03-17 15:03:54 -04:00
2015-03-17 15:01:18 -04:00
2014-11-24 04:28:49 -05:00
2015-03-08 12:25:40 -07:00
2014-12-10 22:41:55 -05:00
2014-11-24 04:28:48 -05:00
2015-01-18 01:03:45 -05:00
2015-01-25 00:23:21 -08:00
2015-03-16 09:36:12 +01:00
2015-01-03 01:51:51 +01:00
2015-01-30 17:58:39 -08:00
2015-03-05 21:51:07 -05:00
2015-02-11 20:25:11 -08:00
2015-02-27 16:06:02 -05:00
2014-11-24 04:28:48 -05:00
2015-02-04 09:15:18 +01:00
2015-03-03 14:38:57 -05:00
2015-03-09 16:17:43 -04:00
2015-01-19 16:20:17 -05:00
2015-03-12 00:28:01 -04:00
2015-02-04 14:57:45 -08:00
2014-11-24 04:28:48 -05:00
2015-03-15 22:20:09 -04:00
2015-03-09 23:44:31 -04:00
2015-02-05 14:33:28 -08:00
2015-03-08 12:53:46 -07:00
2015-02-19 10:36:45 -08:00
2015-03-09 16:20:41 -04:00
2015-01-28 23:15:07 -08:00
2015-02-04 01:34:14 -05:00
2015-03-16 09:36:11 +01:00
2014-11-24 04:28:48 -05:00
2015-03-16 16:16:49 -04:00
2015-02-23 17:22:05 -05:00
2015-01-07 13:08:04 +01:00
2014-12-16 15:53:03 -08:00
2015-02-04 01:34:15 -05:00