Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4177948pxf; Tue, 6 Apr 2021 09:40:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0wrS2j5cz//xD1vOMpKz+SoCntJj2x+xUpHrT8v+GZX4CR6MEPbQITB8E3wwNdCplbdY5 X-Received: by 2002:aa7:c5d0:: with SMTP id h16mr39052360eds.380.1617727237414; Tue, 06 Apr 2021 09:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617727237; cv=none; d=google.com; s=arc-20160816; b=RtrwfLeHTXXHw8vkaszyp+Apob4fNBIyAAWrF6MKWZAwdDPPBcSFQUH0crDijojcuw 8sAe2WfhC0kSaAnw0C+QbxSxmmba9KCx/fY04CnEKV6yxmlrtIaW+85Rd65t5YzDyFjA 2nD+k1Mylm5gpiYZq+MfnJ3lVbp/3kiQ/3FQrpDST2fkWMFFfY4u29wHTWq2SH32Wq9r /g92sTH6WaNQchol1eRZrjyD64SpBethIUEmvEt6lrTH6FQIHvrWiSTxMpVBX50TLCDg /JPtRNzD5XBmtsrL528eDunr2qKGQeiwm1aEPB9KXNkORv+hl5oqTliwBl5fl5CsT0w4 pSIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=vDBKAgbMaImBjwk8LSST01XRtVj8lcYj8qDWJbU+sf4=; b=HHqT8/SS+VG6CE9OYH6VIrN3WG5Wos8YUOlCCPHZAdAibJ1qaVB5Nn2R8nccrdZFwP 3VY3ttSj80zsYPjgY4IlrQVo9FyFvmUzE3f1ovzyceNhp2/ipLW7SiUSDPVqyV324a8b jmSoiTc8b5C5lWxic7xsVGe/f86rnr9UGYBdbhtpLeZTMWBSIgoF9/MDojaJ/NXCZg4h IkPuNikNdNEHDL2at2ATcoD2mHBdnzyR+ph501dEFsQFdxtL1f5nUs+Mo8BVqBpx192B IrO3kZ+EWQ+eeIhGw80d4LK11rH0Brr0ZM+MTwdGQ14/buJIePn+N+omuE4V/jeYQSNm djVQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h16si15721538ejt.695.2021.04.06.09.40.12; Tue, 06 Apr 2021 09:40:37 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234951AbhDFHbZ (ORCPT + 99 others); Tue, 6 Apr 2021 03:31:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:43328 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233476AbhDFHbY (ORCPT ); Tue, 6 Apr 2021 03:31:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 584DAAE6D; Tue, 6 Apr 2021 07:31:16 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id AC7EE60441; Tue, 6 Apr 2021 09:31:15 +0200 (CEST) Date: Tue, 6 Apr 2021 09:31:15 +0200 From: Michal Kubecek To: Yunsheng Lin 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" , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: Packet gets stuck in NOLOCK pfifo_fast qdisc Message-ID: <20210406073115.3h6zehyteagav3f7@lion.mk-sys.cz> References: <5f51cbad3cc2_3eceb208fc@john-XPS-13-9370.notmuch> <20210403003537.2032-1-hdanton@sina.com> <2b99fce1-c235-6083-bd39-cece1f4a0343@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2b99fce1-c235-6083-bd39-cece1f4a0343@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Michal