From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 5ADAE3B29D for ; Tue, 20 Dec 2022 15:24:36 -0500 (EST) Received: by mail-wm1-x32d.google.com with SMTP id r203-20020a1c44d4000000b003d6b8e8e07fso233861wma.0 for ; Tue, 20 Dec 2022 12:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=c2bFmxYT3zvM7I3Ys48664PKtgjsbzVbriVicmQMdGw=; b=jSWkCIpHIW4m8uVPwg+nUCL1OBhT77YlzX+W02eY3BqewrtkOLe7Y8cmO1xVMGLGEO oqVG9ZWCwgVjxq22ZJ1A3PuOwmgd/YqnJMgsZx+jAqHL4v3YkKzj1faqXDkHFQk53Ll9 l9m5fH401mTOEp2kbdiOHog/0mAIIoHJ43eyR+YGmIC+GA4I8HoMDlduckAuQmW2bpBw dJMc0VU1YADCD4EqbLcLXJSZed4ebQYmt4KV/c6daIhBZ2vqm+1y4z1B3Nl2FJND1evC m2RV9vSqAhDhNKCoxanLhNXP3KkkwC1GVpDqPp7U39yqtQoOqZVqqqVRIrG3acgwLFl8 yIcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=c2bFmxYT3zvM7I3Ys48664PKtgjsbzVbriVicmQMdGw=; b=pmEcE4lS6W7eN+DAFcRZkOIUOQWivOKy5SxhNvgpP786I4jqN8FHdyp6bbGC2LzFRb 6CdRd5psmUUFa6JH1q3RbRfkUFkKX1iIz5of5koTcoTRMAhq3RRj9ew9YXVcy/dF9xDK NOUpM/0C0VAMipYZJPir3yWCvfDgvvOzs7Q4tdmN5FSGwpm10Qyjv4bKLKHSWDAmNLE2 7PnFgMl893sHOfQPfrIFc9lcX+GYnprJsSAfBCE6Qjz9I0zuvveT0TtrlKb0SE6DIWGj N2x9AzEVMZULL6wAkAmpml8QJJVL8Ju8Zz+1lLf8Pql7YV7OJ68reuIhL3nBHVVvcsv5 sXaw== X-Gm-Message-State: AFqh2kokUh+r+bT2iRe2dXzDmGWzSzAWAZ07qZngzqVdOoadNbtZCHUL h0llZsW/qU+ojLVbbbp6X8aAi6Q4F5XZoEqSNyM= X-Google-Smtp-Source: AMrXdXuSq2yf8Bgcpq6fUuZvxIgsc4lWZnigfzRkTDiOBwUub5E5UWnIZpQ+V3PWDTcGplUP5UMTnk6O7SL83ywOuFc= X-Received: by 2002:a05:600c:22d4:b0:3cf:a6e8:b59b with SMTP id 20-20020a05600c22d400b003cfa6e8b59bmr1503613wmg.128.1671567874927; Tue, 20 Dec 2022 12:24:34 -0800 (PST) MIME-Version: 1.0 From: Dave Taht Date: Tue, 20 Dec 2022 12:24:21 -0800 Message-ID: To: reiser4@gmail.com, Make-Wifi-fast , OpenWrt Development List , linux-wireless Content-Type: multipart/mixed; boundary="00000000000067467f05f048399c" Subject: [Make-wifi-fast] a nuking the mac80211 changing codel parameters patch X-BeenThere: make-wifi-fast@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2022 20:24:36 -0000 --00000000000067467f05f048399c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This is the single, most buggy, piece of code in "my" portion of wifi today. It is so wrong, yet thus far I cannot get it out of linux or find an acceptable substitute. It makes it hard to sleep at night knowing this code has been so wrong... and now in millions , maybe even 10s of millions, of devices by now.... Since I've been ranting about the wrongness of this for years, I keep hoping that we can excise it, especially for wifi6 devices and even more especially on 6ghz spectrum... but just about everything, somehow, would benefit hugely if we could somehow do more of the right thing here. I'd tried, last time I got this bee in my bonnet, tried to nuke this call h= ere: https://forum.openwrt.org/t/reducing-multiplexing-latencies-still-further-i= n-wifi/133605/ As it is, I really encourage folk, especially with mt79 and to some extent mt76 ac or ath10k, to try out the attached patch, measure tcp rtts, and throughput, etc. A slightly less aggressive patch might suit wifi-n.... Maybe there's a reason for keeping this code in linux wifi that I do not understand. But here are my pithy comments as to why this part of mac80211 is so wrong... static void sta_update_codel_params(struct sta_info *sta, u32 thr) { - if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) { 1) sta->local->num_sta is the number of associated, rather than active, stations. "Active" stations in the last 50ms or so, might have been a better thing to use, but as most people have far more than that associated, we end up with really lousy codel parameters, all the time. Mistake numero uno! 2) The STA_SLOW_THRESHOLD was completely arbitrary in 2016. - sta->cparams.target =3D MS2TIME(50); This, by itself, was probably not too bad. 30ms might have been better, at the time, when we were battling powersave etc, but 20ms was enough, really, to cover most scenarios, even where we had low rate 2Ghz multicast to cope with. Even then, codel has a hard time finding any sane drop rate at all, with a target this high. - sta->cparams.interval =3D MS2TIME(300); But this was horrible, a total mistake, that is leading to codel being completely ineffective in almost any scenario on clients or APS. 100ms, even 80ms, here, would be vastly better than this insanity. I'm seeing 5+seconds of delay accumulated in a bunch of otherwise happily fq-ing APs.... 100ms of observed jitter during a flow is enough. Certainly (in 2016) there were interactions with powersave that I did not understand, and still don't, but if you are transmitting in the first place, powersave shouldn't be a problemmmm..... - sta->cparams.ecn =3D false; At the time we were pretty nervous about ecn, I'm kind of sanguine about it now, and reliably indicating ecn seems better than turning it off for any reason. - } else { - sta->cparams.target =3D MS2TIME(20); - sta->cparams.interval =3D MS2TIME(100); - sta->cparams.ecn =3D true; - } And if we aint gonna fiddle with these, we don't need these either. In production, on p2p wireless, I've had 8ms and 80ms for target and interval for years now, and it works great. It is obviously too low, for those that prize bandwidth over latency (I personally would prefer TXOPs shrink intelligently as well as bandwidth, as you add stations, some of which happens naturally by fq-codels scheduling mechanisms, others don't, I even run with 2ms txops by default on everything myself) + return; Ideally we could kill this entire call off entirely. } A pre-thx for anyone actually trying the attached patch and reporting back on any results. https://forum.openwrt.org/t/reducing-multiplexing-latencies-still-further-i= n-wifi/133605/ --=20 This song goes out to all the folk that thought Stadia would work: https://www.linkedin.com/posts/dtaht_the-mushroom-song-activity-69813666656= 07352320-FXtz Dave T=C3=A4ht CEO, TekLibre, LLC --00000000000067467f05f048399c Content-Type: text/x-patch; charset="US-ASCII"; name="killcodel.patch" Content-Disposition: attachment; filename="killcodel.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lbwng7ft0 ZGlmZiAtLWdpdCBhL25ldC9tYWM4MDIxMS9zdGFfaW5mby5jIGIvbmV0L21hYzgwMjExL3N0YV9p bmZvLmMKaW5kZXggOTdkMjRlOS4uNDU3MjA5YSAxMDA2NDQKLS0tIGEvbmV0L21hYzgwMjExL3N0 YV9pbmZvLmMKKysrIGIvbmV0L21hYzgwMjExL3N0YV9pbmZvLmMKQEAgLTI3NjYsMTUgKzI3NjYs NyBAQCB1bnNpZ25lZCBsb25nIGllZWU4MDIxMV9zdGFfbGFzdF9hY3RpdmUoc3RydWN0IHN0YV9p bmZvICpzdGEpCiAKIHN0YXRpYyB2b2lkIHN0YV91cGRhdGVfY29kZWxfcGFyYW1zKHN0cnVjdCBz dGFfaW5mbyAqc3RhLCB1MzIgdGhyKQogewotCWlmICh0aHIgJiYgdGhyIDwgU1RBX1NMT1dfVEhS RVNIT0xEICogc3RhLT5sb2NhbC0+bnVtX3N0YSkgewotCQlzdGEtPmNwYXJhbXMudGFyZ2V0ID0g TVMyVElNRSg1MCk7Ci0JCXN0YS0+Y3BhcmFtcy5pbnRlcnZhbCA9IE1TMlRJTUUoMzAwKTsKLQkJ c3RhLT5jcGFyYW1zLmVjbiA9IGZhbHNlOwotCX0gZWxzZSB7Ci0JCXN0YS0+Y3BhcmFtcy50YXJn ZXQgPSBNUzJUSU1FKDIwKTsKLQkJc3RhLT5jcGFyYW1zLmludGVydmFsID0gTVMyVElNRSgxMDAp OwotCQlzdGEtPmNwYXJhbXMuZWNuID0gdHJ1ZTsKLQl9CisJcmV0dXJuOwogfQogCiB2b2lkIGll ZWU4MDIxMV9zdGFfc2V0X2V4cGVjdGVkX3Rocm91Z2hwdXQoc3RydWN0IGllZWU4MDIxMV9zdGEg KnB1YnN0YSwK --00000000000067467f05f048399c--