Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1512792

Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep

From Eric Dumazet <eric.dumazet@gmail.com>
Newsgroups linux.kernel
Subject Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep
Date 2016-10-31 19:50 +0100
Message-ID <sypOG-694-9@gated-at.bofh.it> (permalink)
References (4 earlier) <sxGeR-1yf-3@gated-at.bofh.it> <sxGeR-1yf-5@gated-at.bofh.it> <sxQed-8i8-3@gated-at.bofh.it> <sxYlr-5b8-5@gated-at.bofh.it> <sypbY-5T4-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 2016-10-31 at 11:00 -0700, Cong Wang wrote:
> On Sun, Oct 30, 2016 at 6:20 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > On Sun, 2016-10-30 at 05:41 +0100, Andrey Konovalov wrote:
> >> Sorry, the warning is still there.
> >>
> >> I'm not sure adding sched_annotate_sleep() does anything, since it's
> >> defined as (in case CONFIG_DEBUG_ATOMIC_SLEEP is not set):
> >> # define sched_annotate_sleep() do { } while (0)
> >
> > Thanks again for testing.
> >
> > But you do have CONFIG_DEBUG_ATOMIC_SLEEP set, which triggers a check in
> > __might_sleep() :
> >
> > WARN_ONCE(current->state != TASK_RUNNING && current->task_state_change,
> >
> > Relevant commit is 00845eb968ead28007338b2bb852b8beef816583
> > ("sched: don't cause task state changes in nested sleep debugging")
> >
> > Another relevant commit was 26cabd31259ba43f68026ce3f62b78094124333f
> > ("sched, net: Clean up sk_wait_event() vs. might_sleep()")
> >
> > Before release_sock() could process the backlog in process context, only
> > lock_sock() could trigger the issue, so my fix at that time was commit
> > cb7cf8a33ff73cf638481d1edf883d8968f934f8 ("inet: Clean up
> > inet_csk_wait_for_connect() vs. might_sleep()")
> >
> 
> Thanks for the context, but isn't the original warning reported by Andrey is
> from inet_wait_for_connect()? You seem only patch some dccp function
> which is why it is still there?
> 
> It should be the following, no?
> 
> 
> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> index 9648c97..bbd8159 100644
> --- a/net/ipv4/af_inet.c
> +++ b/net/ipv4/af_inet.c
> @@ -544,6 +544,7 @@ static long inet_wait_for_connect(struct sock *sk,
> long timeo, int writebias)
>          * without closing the socket.
>          */
>         while ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) {
> +               sched_annotate_sleep();
>                 release_sock(sk);
>                 timeo = schedule_timeout(timeo);
>                 lock_sock(sk);

Yes, this would be one of the locations needing this.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Andrey Konovalov <andreyknvl@google.com> - 2016-10-29 02:50 +0200
  Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Cong Wang <xiyou.wangcong@gmail.com> - 2016-10-29 08:20 +0200
    Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Andrey Konovalov <andreyknvl@google.com> - 2016-10-29 19:10 +0200
      Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Eric Dumazet <eric.dumazet@gmail.com> - 2016-10-29 19:50 +0200
        Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Andrey Konovalov <andreyknvl@google.com> - 2016-10-29 20:10 +0200
          Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Eric Dumazet <eric.dumazet@gmail.com> - 2016-10-29 20:10 +0200
            Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Andrey Konovalov <andreyknvl@google.com> - 2016-10-30 05:50 +0100
              Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Eric Dumazet <eric.dumazet@gmail.com> - 2016-10-30 14:30 +0100
                Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Cong Wang <xiyou.wangcong@gmail.com> - 2016-10-31 19:10 +0100
                Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Eric Dumazet <eric.dumazet@gmail.com> - 2016-10-31 19:50 +0100
                Re: net/dccp: warning in dccp_feat_clone_sp_val/__might_sleep Andrey Konovalov <andreyknvl@google.com> - 2016-11-01 17:40 +0100

csiph-web