All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] inet: Clean up inet_csk_wait_for_connect() vs. might_sleep()
Date: Tue, 17 Mar 2015 08:35:01 +0100	[thread overview]
Message-ID: <20150317073501.GP2896@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <1426533564.11398.229.camel@edumazet-glaptop2.roam.corp.google.com>

On Mon, Mar 16, 2015 at 12:19:24PM -0700, Eric Dumazet wrote:
> 
> In commit 26cabd31259ba43f68026ce3f62b78094124333f
> Peter added a sched_annotate_sleep() in sk_wait_event()
> 
> Is the following patch needed as well ?

Yes this is fine.

If we had indeed gone through the schedule and got woken we'd have had
TASK_RUNNING here, also when we retry the loop the prepare_to_wait call
will (re)set the TASK_INTERRUPTIBLE state.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  net/ipv4/inet_connection_sock.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
> index 14d02ea905b6..3e44b9b0b78e 100644
> --- a/net/ipv4/inet_connection_sock.c
> +++ b/net/ipv4/inet_connection_sock.c
> @@ -268,6 +268,7 @@ static int inet_csk_wait_for_connect(struct sock *sk, long timeo)
>  		release_sock(sk);
>  		if (reqsk_queue_empty(&icsk->icsk_accept_queue))
>  			timeo = schedule_timeout(timeo);
> +		sched_annotate_sleep();
>  		lock_sock(sk);
>  		err = 0;
>  		if (!reqsk_queue_empty(&icsk->icsk_accept_queue))
> 
> 
> 

  parent reply	other threads:[~2015-03-17  7:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 19:19 [PATCH] inet: Clean up inet_csk_wait_for_connect() vs. might_sleep() Eric Dumazet
2015-03-16 21:12 ` David Miller
2015-03-16 22:24   ` Eric Dumazet
2015-03-17  7:35 ` Peter Zijlstra [this message]
2015-03-17 19:04 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150317073501.GP2896@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.