Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp46513pxf; Tue, 6 Apr 2021 14:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8/iPOUabylVdMMLmgI3ZkYl/IVJRT929HQ4QEUfvtmQt+sdtECoSFwZkHIc3huKJokRel X-Received: by 2002:a05:6402:430c:: with SMTP id m12mr497412edc.138.1617744910607; Tue, 06 Apr 2021 14:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617744910; cv=none; d=google.com; s=arc-20160816; b=n998JxOSS520/5wyTeVphx2oTnQX6lzxXEAByjLhSapZpHmZrcjBvNtM3Kmc9uutHN /dIV3wTLXyD+/e0F8ZkGm8gT8teWUMFG6E+Or/brexH2BlcH8NEpxm1MhddS8GNTx70e 3xYN/gMjTUtFyb5hYhHfDlRy0hY9jwUUmtPjmUlyKOLcej6aS8GprO2caa/MhAW6jaVT toK2ERftREAYSW6OA25Byvbj/Ty1SJfFc8/G1IsCuOIYCoMN6Ud2erN/Jcnl1MxDekgS SEVahTdr26QvGA/xVdyaHLhZqml1kzrEDrdl2ZmnN0ZyFDjOo70lnUUVWKRGE/n8GsfR 2/0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=169Sg2DYdHrw+viGGlvCtE7YPE6//qgfbP2jC1VI1AM=; b=nJdXPBeRVlqGp7uOHz1jbuAosDVfn79e9OBYJJU8Z42luxJ3kjG0XWnkY6gRTQXbnb Z3UsBZoqQsFraHprrmfP2qPbNEDI9ed2BsTOTFS4JJQcgM+sYTToYZFvu26iKM3hFR8f +YgUemE02RR5dpR8poh0sfSrMcHmGUiCZ1HFDN8hsety+Z3L680IMueP0YTOsyLKSYUZ 0lx4+ycq8Wo0d0cu8t1KfiYDL4OsptQbdUb+n36CTgeaCdP0+AHHTvWDRFhrgxGZQPsu ripDu6umyK5WA7IgCgaC7PZftuKwa0TJyL7Zbbf98zFH7dfkEIuXQ77idZ/7q/WHWMpo T05w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si8995048edw.153.2021.04.06.14.33.37; Tue, 06 Apr 2021 14:35:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237906AbhDFMY2 (ORCPT + 99 others); Tue, 6 Apr 2021 08:24:28 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5121 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230309AbhDFMY0 (ORCPT ); Tue, 6 Apr 2021 08:24:26 -0400 Received: from DGGEML402-HUB.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FF6941R2VzYTBY; Tue, 6 Apr 2021 20:22:16 +0800 (CST) Received: from dggpemm500005.china.huawei.com (7.185.36.74) by DGGEML402-HUB.china.huawei.com (10.3.17.38) with Microsoft SMTP Server (TLS) id 14.3.498.0; Tue, 6 Apr 2021 20:24:14 +0800 Received: from [127.0.0.1] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Tue, 6 Apr 2021 20:24:15 +0800 Subject: Re: Packet gets stuck in NOLOCK pfifo_fast qdisc To: Michal Kubecek CC: Cong Wang , Jiri Kosina , Hillf Danton , John Fastabend , Paolo Abeni , Kehuan Feng , "Jike Song" , Michael Zhivich , "David Miller" , LKML , Netdev , Josh Hunt , "Jason A. Donenfeld" , =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= References: <5f51cbad3cc2_3eceb208fc@john-XPS-13-9370.notmuch> <20210403003537.2032-1-hdanton@sina.com> <2b99fce1-c235-6083-bd39-cece1f4a0343@huawei.com> <20210406073115.3h6zehyteagav3f7@lion.mk-sys.cz> From: Yunsheng Lin Message-ID: <30b4e9a4-c0ad-8ac5-0bbb-f186f1caf7a7@huawei.com> Date: Tue, 6 Apr 2021 20:24:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20210406073115.3h6zehyteagav3f7@lion.mk-sys.cz> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggeme716-chm.china.huawei.com (10.1.199.112) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/4/6 15:31, Michal Kubecek wrote: > On Tue, Apr 06, 2021 at 10:46:29AM +0800, Yunsheng Lin wrote: >> On 2021/4/6 9:49, Cong Wang wrote: >>> On Sat, Apr 3, 2021 at 5:23 AM Jiri Kosina wrote: >>>> >>>> I am still planning to have Yunsheng Lin's (CCing) fix [1] tested in the >>>> coming days. If it works, then we can consider proceeding with it, >>>> otherwise I am all for reverting the whole NOLOCK stuff. >>>> >>>> [1] https://lore.kernel.org/linux-can/1616641991-14847-1-git-send-email-linyunsheng@huawei.com/T/#u >>> >>> I personally prefer to just revert that bit, as it brings more troubles >>> than gains. Even with Yunsheng's patch, there are still some issues. >>> Essentially, I think the core qdisc scheduling code is not ready for >>> lockless, just look at those NOLOCK checks in sch_generic.c. :-/ >> >> I am also awared of the NOLOCK checks too:), and I am willing to >> take care of it if that is possible. >> >> As the number of cores in a system is increasing, it is the trend >> to become lockless, right? Even there is only one cpu involved, the >> spinlock taking and releasing takes about 30ns on our arm64 system >> when CONFIG_PREEMPT_VOLUNTARY is enable(ip forwarding testing). > > I agree with the benefits but currently the situation is that we have > a race condition affecting the default qdisc which is being hit in > production and can cause serious trouble which is made worse by commit > 1f3279ae0c13 ("tcp: avoid retransmits of TCP packets hanging in host > queues") preventing the retransmits of the stuck packet being sent. > > Perhaps rather than patching over current implementation which requires > more and more complicated hacks to work around the fact that we cannot > make the "queue is empty" check and leaving the critical section atomic, > it would make sense to reimplement it in a way which would allow us > making it atomic. Yes, reimplementing that is also an option. But what if reimplemention also has the same problem if we do not find the root cause of this problem? I think it better to find the root cause of it first? > > Michal > > > . >