Skip to content

Commit 26cabd3

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
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]>
1 parent 3c9b2c3 commit 26cabd3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/net/sock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ static inline void sock_rps_reset_rxhash(struct sock *sk)
897897
if (!__rc) { \
898898
*(__timeo) = schedule_timeout(*(__timeo)); \
899899
} \
900+
sched_annotate_sleep(); \
900901
lock_sock(__sk); \
901902
__rc = __condition; \
902903
__rc; \

0 commit comments

Comments
 (0)