From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 157D4C10F0E for ; Tue, 9 Apr 2019 07:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2CB920857 for ; Tue, 9 Apr 2019 07:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726517AbfDIHwp (ORCPT ); Tue, 9 Apr 2019 03:52:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbfDIHwp (ORCPT ); Tue, 9 Apr 2019 03:52:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B253181E10; Tue, 9 Apr 2019 07:52:44 +0000 (UTC) Received: from localhost.localdomain (unknown [10.32.181.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFE745D71B; Tue, 9 Apr 2019 07:52:41 +0000 (UTC) Message-ID: <0f1b4b528b14822c067a4c20f237f2a02c719dfa.camel@redhat.com> Subject: Re: [PATCH net-next 5/5] Revert: "net: sched: put back q.qlen into a single location" From: Paolo Abeni To: Eric Dumazet , netdev@vger.kernel.org Cc: "David S. Miller" , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Eric Dumazet , Ivan Vecera Date: Tue, 09 Apr 2019 09:52:40 +0200 In-Reply-To: <1871d6ac-cb83-69a5-608c-d944fa93b315@gmail.com> References: <033147df6656a912ba311184e55916333b3745b1.1554740883.git.pabeni@redhat.com> <1871d6ac-cb83-69a5-608c-d944fa93b315@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 09 Apr 2019 07:52:45 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, On Mon, 2019-04-08 at 14:17 -0700, Eric Dumazet wrote: > On 04/08/2019 09:35 AM, Paolo Abeni wrote: > > This revert commit 46b1c18f9deb ("net: sched: put back q.qlen > > into a single location"). > > After the previous patch nobody accesses directly qlen for a child > > qdisc when such qdisc does per CPU stats accounting. > > In the control path nobody uses directly qlen since commit > > 677f1bc207c ("net: sched: introduce and use qdisc tree flush/purge > > helpers"), so we can remove the contented atomic ops from the > > datapath. > > > > Have you tested HTB with a pfifo_fast on a throttled class ? > > I do not see any changes in HTB in your patch series, so it is not > clear why your patch series is not adding back the issue. Thank you for the feedback. I tested this series enslaving pfifo_fast to each classful qdiscs - including HTB - sending traffic through the pfifo_fast qdisc, and checking correct accounting. When pfifo_fast is enslaved to HTB, the NOLOCK flag is cleared - by qdisc_graft(), as HTB is a lock qdisc. As per patch 4/5, TCQ_F_CPUSTATS is cleared, too, so pfifo_fast switches to global accounting, under root lock protection. In HTB context, ->q.qlen should be always valid, no changes required there, nor to any other classful qdisc - until we will have lockless classful qdiscs: they should not access ->q.qlen directly. Please let me know if the above is somewhat clear. Have I missed something? Thanks, Paolo