Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3432484rwe; Mon, 29 Aug 2022 11:35:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR5rrRIupsrArvgehA6BkCvaKVm2aNDBg1XvJyBVxwGYI0ivYlNjcUFrJOGSc9JUySRazqqD X-Received: by 2002:a17:902:b184:b0:172:766e:7f35 with SMTP id s4-20020a170902b18400b00172766e7f35mr17478374plr.174.1661798127522; Mon, 29 Aug 2022 11:35:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661798127; cv=none; d=google.com; s=arc-20160816; b=VymtUXQeKlw1Uk2zv0/KS30AygMBOZKO+Lv13YV2P0Bdwh37nt2KM+66mQeMtoF8Rq QF7WiwaQIMnNoa9nz2lN7N+yhh7Gi+XpEBYMvtigHKzzgmInSPAg8jJohZA2Lb3I87LF Bdia+Li6Nasu0kCajowGiBWbOFky/YSC87rOyKRtEeRqNaGuH56lgzSvHeULR8Q7yxvl y/kcI12M3w9tysrp2kEGOh16gGyed/K7gOxN4kyZZHizYesYdKmCJrknBUIkG7SbZjMo y3j+mPXjTsndGzRHki6EGo2PWND3XtjvsJH8khLGUxTPlBmBhgCowJd4daOzGxKXOySJ F+bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9MtsKETAQYOSHqFu76VaqNu9/OI/sudex9QgrJ+4kBc=; b=ClHfEHDSU8Gq78DUzfr/zfx2loBGySRRtaXdLNOm3M4VYSF9npR7uxKSBibqkaFrPx tSilqW8yNUxN9nCLVR0zKZjm0Sha1LQW04LFpI5nQhWsiIEb3Kuw2I+u9dVzC0hTzAeV niJjBBj8zUhdt3u6RsuS1RLmRW324qS6GifuQa6i61zB07Bh1PLpk98lg46VIQKmu8Ji HSXBNXuwDBNfVg11JaOabjtqYKnu+wRMEK5TFCA+8NPiJJ1w7ct1hHj3FvoNC/RhldBl fyvQnrMbVmlX3mlmRt1e/zulePc7yRJ7AeEaKOUPc/3rtWtELmpQlbhiq+CF00/O508a AFkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=GkigFTjy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a056a00230f00b00536009c81b7si10115740pfh.148.2022.08.29.11.35.15; Mon, 29 Aug 2022 11:35:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=GkigFTjy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229888AbiH2QyB (ORCPT + 99 others); Mon, 29 Aug 2022 12:54:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbiH2Qx6 (ORCPT ); Mon, 29 Aug 2022 12:53:58 -0400 Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51C278A6D6 for ; Mon, 29 Aug 2022 09:53:56 -0700 (PDT) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-3376851fe13so211038137b3.6 for ; Mon, 29 Aug 2022 09:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=9MtsKETAQYOSHqFu76VaqNu9/OI/sudex9QgrJ+4kBc=; b=GkigFTjyHH7is6HjX0lTNqflphvgUtePF1XkUbJ96E6tMjfmSRYp9GOrgI3MdlbNUo QYZMp/AJjX8zb0DFpUP54KXklFUXSYyiPnQ+BdDPTuaVrnC+76pjnqSwWb2IShm+3vg9 qYyMFQonnPOUNhlaPQ6vo/y/78MMn/2z7Su6JqZ8m0il46X0xHmcCfcPX1ANvneijpz+ 7x7HQhve0w11lcy3wQguKjS21Aw9iu2kT14R25/YV6nkbSEcpB9yOy8aGppE28AOGLOA Ecr2pOqoJDmImu9wRyxaIrqFwyebiYoFdK3nI/XhhHGEf34fCazy8PBXbCHBzPSeauOv 4wJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=9MtsKETAQYOSHqFu76VaqNu9/OI/sudex9QgrJ+4kBc=; b=VTeSTiiXVpO4b1iXYGB4eNNs7oGSLPLJyryfnK5JHsCI5bR5/lHAoxF6THNZHs5E0Y MiPQFMo7ZXNNUGrm2D5fF5bxt7bKNd8nSappf9218O9derq6b2Q77VUX9DLbWWF77oUe opV7n3FnYObwAp3pcxzLIxKkI51rmJWPv35HqXI37x+c1Bv01xsMYmgWUAuCWL4AYHcG IrG8NFTDfW9F/FQkqH5NIXOTfUC7j/MeRnypXzdmp+mw+ExI6S7Bt0MMCpD4Nv1KgEef RMDRZeiKJM2U9bPs8AjkSirsVjSA7EdVnlJmkMZArkm2bvXI9fRJeX8bZDuxmB2TTuFs A1Lw== X-Gm-Message-State: ACgBeo14tOiaMPHOXzI4Vpsn4ikHufTvjnJz2ugILonC8+5506mqNj/t HIqrWOtxHVt33lZIijFgZvNZZZG8EnzXL9JYyUNmLQ== X-Received: by 2002:a25:b78a:0:b0:695:900e:e211 with SMTP id n10-20020a25b78a000000b00695900ee211mr8421162ybh.427.1661792034737; Mon, 29 Aug 2022 09:53:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Dumazet Date: Mon, 29 Aug 2022 09:53:43 -0700 Message-ID: Subject: Re: [PATCH RFC v2 net-next 0/5] net: Qdisc backpressure infrastructure To: Cong Wang Cc: Peilin Ye , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Hideaki YOSHIFUJI , David Ahern , Jamal Hadi Salim , Jiri Pirko , Peilin Ye , netdev , "open list:DOCUMENTATION" , LKML , Cong Wang , Stephen Hemminger , Dave Taht Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 29, 2022 at 9:47 AM Cong Wang wrote: > > On Mon, Aug 22, 2022 at 09:22:39AM -0700, Eric Dumazet wrote: > > On Mon, Aug 22, 2022 at 2:10 AM Peilin Ye wrote: > > > > > > From: Peilin Ye > > > > > > Hi all, > > > > > > Currently sockets (especially UDP ones) can drop a lot of packets at TC > > > egress when rate limited by shaper Qdiscs like HTB. This patchset series > > > tries to solve this by introducing a Qdisc backpressure mechanism. > > > > > > RFC v1 [1] used a throttle & unthrottle approach, which introduced several > > > issues, including a thundering herd problem and a socket reference count > > > issue [2]. This RFC v2 uses a different approach to avoid those issues: > > > > > > 1. When a shaper Qdisc drops a packet that belongs to a local socket due > > > to TC egress congestion, we make part of the socket's sndbuf > > > temporarily unavailable, so it sends slower. > > > > > > 2. Later, when TC egress becomes idle again, we gradually recover the > > > socket's sndbuf back to normal. Patch 2 implements this step using a > > > timer for UDP sockets. > > > > > > The thundering herd problem is avoided, since we no longer wake up all > > > throttled sockets at the same time in qdisc_watchdog(). The socket > > > reference count issue is also avoided, since we no longer maintain socket > > > list on Qdisc. > > > > > > Performance is better than RFC v1. There is one concern about fairness > > > between flows for TBF Qdisc, which could be solved by using a SFQ inner > > > Qdisc. > > > > > > Please see the individual patches for details and numbers. Any comments, > > > suggestions would be much appreciated. Thanks! > > > > > > [1] https://lore.kernel.org/netdev/cover.1651800598.git.peilin.ye@bytedance.com/ > > > [2] https://lore.kernel.org/netdev/20220506133111.1d4bebf3@hermes.local/ > > > > > > Peilin Ye (5): > > > net: Introduce Qdisc backpressure infrastructure > > > net/udp: Implement Qdisc backpressure algorithm > > > net/sched: sch_tbf: Use Qdisc backpressure infrastructure > > > net/sched: sch_htb: Use Qdisc backpressure infrastructure > > > net/sched: sch_cbq: Use Qdisc backpressure infrastructure > > > > > > > I think the whole idea is wrong. > > > > Be more specific? > > > Packet schedulers can be remote (offloaded, or on another box) > > This is not the case we are dealing with (yet). > > > > > The idea of going back to socket level from a packet scheduler should > > really be a last resort. > > I think it should be the first resort, as we should backpressure to the > source, rather than anything in the middle. > > > > > Issue of having UDP sockets being able to flood a network is tough, I > > am not sure the core networking stack > > should pretend it can solve the issue. > > It seems you misunderstand it here, we are not dealing with UDP on the > network, just on an end host. The backpressure we are dealing with is > from Qdisc to socket on _TX side_ and on one single host. > > > > > Note that FQ based packet schedulers can also help already. > > It only helps TCP pacing. FQ : Fair Queue. It definitely helps without the pacing part... > > Thanks.