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.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 DCBD7C43381 for ; Wed, 27 Feb 2019 16:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A635E2186A for ; Wed, 27 Feb 2019 16:59:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hdn9XqLI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729364AbfB0Q7T (ORCPT ); Wed, 27 Feb 2019 11:59:19 -0500 Received: from mail-pg1-f172.google.com ([209.85.215.172]:45418 "EHLO mail-pg1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfB0Q7S (ORCPT ); Wed, 27 Feb 2019 11:59:18 -0500 Received: by mail-pg1-f172.google.com with SMTP id y4so8215732pgc.12 for ; Wed, 27 Feb 2019 08:59:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mCWVJFFN2ZuFCbvc4XfD2Rq8oOCb6e8g5y8xGlKEyjY=; b=hdn9XqLIRxjJhFjOpduwFIcJe4kY+wBUUkOZ+bpX3pAsbWYfXAorwCPUo+WjqsA1Op XbcyuuIX+Y7FP+0w4RprmeeJl14P9XTw15JyYmpMu3N8rAVkKZErdVzfoHi+iodlkJqb CrchET54S9DU+/PuZZvbcA4OTDt9oYFe+OQsRElVgiAWuwaIRa5L5BVLNvzPQP/sd6PP darN3c+S590EH7Q0cH3OtXnjP7WLOnQUVlynBtn3FSU7+y36iGbWk2i/ucLJ8WcUKGpm ET01zD0B+ozaO2MxrBV1B5RGnlq4hoCa58FpPYDKruRdSVSKqpZoGou7kxkHJQf1tSVt CScQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mCWVJFFN2ZuFCbvc4XfD2Rq8oOCb6e8g5y8xGlKEyjY=; b=KjS9sTjt4dgYdDKvDUrn2QcEiBtk0TuQn8Chim0vS9x8bULL7LmlpaB8qpm3xLg/He bjcvjqJMP57Un4RjX1pz78z9oArXO4/LBEXpZBbVlHlFlp2ZZGlCJHJ5zko+LPotQXTX VMm4x87IQSNG+BBDCnvfWD1IaqsK/7d0s8B07VGNnlfQNPjdPlA93b7Goa4JHscjES1B 5qXUOqex+dEjvXkd4TflnGA+EsGOaDxL3MFbmIJbFNWruYnDte6znTWQAZ7fClHrRCU1 nN46z1if1wGnuG2sRHTKtR6qn+5NpyxgscU5Lwm9WERGFX0ASr2oUsrZewGr0XlQfE1W ae/Q== X-Gm-Message-State: AHQUAuYEkGC+H/SLRF7SmQFwQbbvzhgwfa0FWJi1v77QX5LXd+JFvFXK 47LRH7nDCkINke12E1BSyV8= X-Google-Smtp-Source: AHgI3IZcUWUbj1iWy5TJjiyQ7gP9DsYIKs10Pp2QEGu6+0a/A3U7keCdtPkUVtnlNmWadhlFxVbhdQ== X-Received: by 2002:a63:6bc1:: with SMTP id g184mr3924800pgc.25.1551286757985; Wed, 27 Feb 2019 08:59:17 -0800 (PST) Received: from ?IPv6:2620:15c:2c1:200:55c7:81e6:c7d8:94b? ([2620:15c:2c1:200:55c7:81e6:c7d8:94b]) by smtp.gmail.com with ESMTPSA id m17sm28815767pff.170.2019.02.27.08.59.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 08:59:16 -0800 (PST) Subject: Re: [BUG] net/sched : qlen can not really be per cpu ? From: Eric Dumazet To: Cong Wang Cc: John Fastabend , Networking , Jamal Hadi Salim , Jiri Pirko References: <5fb87db3-d5bd-714b-213d-6821f4bf37da@gmail.com> Message-ID: Date: Wed, 27 Feb 2019 08:59:15 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 02/26/2019 04:56 PM, Eric Dumazet wrote: > > > On 02/26/2019 03:51 PM, Cong Wang wrote: >> On Tue, Feb 26, 2019 at 3:19 PM Eric Dumazet wrote: >>> >>> >>> >>> On 02/25/2019 10:42 PM, Eric Dumazet wrote: >>>> HTB + pfifo_fast as a leaf qdisc hits badly the following warning in htb_activate() : >>>> >>>> WARN_ON(cl->level || !cl->leaf.q || !cl->leaf.q->q.qlen); >>>> >>>> This is because pfifo_fast does not update sch->q.qlen, but per cpu counters. >>>> So cl->leaf.q->q.qlen is zero. >>>> >>>> HFSC, CBQ, DRR, QFQ have the same problem. >>>> >>>> Any ideas how we can fix this ? >>> >>> What about something simple for stable ? >>> ( I yet have to boot/test this ) >> >> Is merely updating qlen sufficient for fixing it? >> >> I thought it is because of the lack of qdisc_tree_reduce_backlog() >> in pfifo_fast. > > It does not seem to be the qdisc_tree_reduce_backlog() thing. > > HTB, HFSC, CBQ, DRR, QFQ only peek at their children 'qlen' to decide if there > is at least one packet in them. > > The backlog is only reported for dumps, but the actual backlog value is not used in data path. > > Another way to fix this would be to have a shadow version of pfifo_fast, which basically would be the old version of it, that would be automatically selected when used as a child of another qdisc (except mq/mqprio of course) This seems not a stable candidate though.