From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752747AbbCQHfJ (ORCPT ); Tue, 17 Mar 2015 03:35:09 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:55689 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbbCQHfH (ORCPT ); Tue, 17 Mar 2015 03:35:07 -0400 Date: Tue, 17 Mar 2015 08:35:01 +0100 From: Peter Zijlstra To: Eric Dumazet Cc: David Miller , netdev , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] inet: Clean up inet_csk_wait_for_connect() vs. might_sleep() Message-ID: <20150317073501.GP2896@worktop.programming.kicks-ass.net> References: <1426533564.11398.229.camel@edumazet-glaptop2.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426533564.11398.229.camel@edumazet-glaptop2.roam.corp.google.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) > Signed-off-by: Eric Dumazet > --- > 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)) > > >