sched, net: Clean up sk_wait_event() vs. might_sleep()
authorPeter Zijlstra <[email protected]>
Wed, 24 Sep 2014 08:18:54 +0000 (10:18 +0200)
committerIngo Molnar <[email protected]>
Tue, 28 Oct 2014 09:56:37 +0000 (10:56 +0100)
commit26cabd31259ba43f68026ce3f62b78094124333f
tree8767ef0e03cb669bb361da73a8ae609c38b7f41b
parent3c9b2c3d64a49f264422d7743599cf7f6535972d
sched, net: Clean up sk_wait_event() vs. might_sleep()

WARNING: CPU: 1 PID: 1744 at kernel/sched/core.c:7104 __might_sleep+0x58/0x90()
do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffff81070e10>] prepare_to_wait+0x50 /0xa0

 [<ffffffff8105bc38>] __might_sleep+0x58/0x90
 [<ffffffff8148c671>] lock_sock_nested+0x31/0xb0
 [<ffffffff81498aaa>] sk_stream_wait_memory+0x18a/0x2d0

Which is a false positive because sk_wait_event() will already have
TASK_RUNNING at that point if it would've gone through
schedule_timeout().

So annotate with sched_annotate_sleep(); which goes away on !DEBUG builds.

Reported-by: Ilya Dryomov <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Cc: David S. Miller <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/net/sock.h