On Wed, Sep 24, 2014 at 10:18:54AM +0200, Peter Zijlstra wrote:
> 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 fixup_sleep(); which goes away on !DEBUG builds.
> 
> Cc: [email protected]
> Cc: David Miller <[email protected]>
> Reported-by: Ilya Dryomov <[email protected]>
> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>

Dave, FYI this patch relies on a previous one that introduces the
fixup_sleep()

 lkml.kernel.org/r/[email protected]

If you're ok with things, I'll merge this one along with the rest of
things.

> ---
>  include/net/sock.h |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -902,6 +902,7 @@ static inline void sock_rps_reset_rxhash
>               if (!__rc) {                                            \
>                       *(__timeo) = schedule_timeout(*(__timeo));      \
>               }                                                       \
> +             fixup_sleep();                                          \
>               lock_sock(__sk);                                        \
>               __rc = __condition;                                     \
>               __rc;                                                   \
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to