From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net] tcp/dccp: block bh before arming time_wait timer Date: Fri, 01 Dec 2017 12:51:26 -0800 Message-ID: <1512161486.19682.45.camel@gmail.com> References: <1512151616.19682.44.camel@gmail.com> <20171201.151244.214660651517525372.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, maze@google.com To: David Miller Return-path: Received: from mail-it0-f66.google.com ([209.85.214.66]:43117 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdLAUv3 (ORCPT ); Fri, 1 Dec 2017 15:51:29 -0500 Received: by mail-it0-f66.google.com with SMTP id u62so3899836ita.2 for ; Fri, 01 Dec 2017 12:51:29 -0800 (PST) In-Reply-To: <20171201.151244.214660651517525372.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 2017-12-01 at 15:12 -0500, David Miller wrote: > From: Eric Dumazet > Date: Fri, 01 Dec 2017 10:06:56 -0800 > > > From: Eric Dumazet > >  > > Maciej Żenczykowski reported some panics in tcp_twsk_destructor() > > that might be caused by the following bug. > >  > > timewait timer is pinned to the cpu, because we want to transition > > timwewait refcount from 0 to 4 in one go, once everything has been > > initialized. > >  > > At the time commit ed2e92394589 ("tcp/dccp: fix timewait races in > timer > > handling") was merged, TCP was always running from BH habdler. > >  > > After commit 5413d1babe8f ("net: do not block BH while processing > > socket backlog") we definitely can run tcp_time_wait() from process > > context. > >  > > We need to block BH in the critical section so that the pinned > timer > > has still its purpose. > >  > > This bug is more likely to happen under stress and when very small > RTO > > are used in datacenter flows. > >  > > Fixes: 5413d1babe8f ("net: do not block BH while processing socket > backlog") > > Signed-off-by: Eric Dumazet > > Reported-by: Maciej Żenczykowski > > Applied and queued up for -stable, thanks Eric. It just occurred to me that we can now revert 614bdd4d6e61d26 ("tcp: must block bh in __inet_twsk_hashdance()")