Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Dave Taht <dave.taht@gmail.com>
To: Sebastian Gottschall <s.gottschall@newmedia-net.de>
Cc: "Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Dave Taht" <dave@taht.net>,
	"Cake List" <cake@lists.bufferbloat.net>,
	Make-Wifi-fast <make-wifi-fast@lists.bufferbloat.net>
Subject: Re: [Cake] Wifi Memory limits in small platforms
Date: Thu, 22 Aug 2019 07:59:13 -0700	[thread overview]
Message-ID: <CAA93jw5pA7JhQD1PL_7XHnOkU-sxxrnF0a7Asmzb+CXW=NMzjQ@mail.gmail.com> (raw)
In-Reply-To: <CAA93jw4=13D-+WHLYPiV4NPqeVJwrLJe=nkr+a9D9Cqvq49pEQ@mail.gmail.com>

People have a tendency to try and construct very complicated QoS
systems and then try to run them in limited memory. We see a lot of 6
or 7 class hfsc + sfq or fq_codel systems, which can accumulate
hundreds or thousands of packets before doing a drop. A stress test
like ping -f -s 1500 and ping -f -s 64 hitting every defined queue
(somehow) should be run to make sure you don't OOM, and even, even
then, things like acks coming off an ethernet eat 2k when they are
only 64 bytes in size.

this patch (Not even compile tested) might take some of the memory
pressure off when being flooded in this way. While
it costs cpu, given a choice between ooming and slowing down, I'd
rather slow down. Should have done tbf too.

I wonder if the large number of queues we've seen people try to use
with hfsc has been one of the sources of
frequent reports of flakyness? How many queues do people actually try
to create with it in the field... Certainly sfq's default of 127
packets is better than 1000...

Reducing the truesize could be added to cake and tbf also. As well as
the fq_codel for wifi code, on small platforms.

diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 433f2190960f..c0777ce4a259 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1535,7 +1535,8 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc
*sch, struct sk_buff **to_free)
        struct hfsc_class *cl;
        int uninitialized_var(err);
        bool first;
-
+       if (sch->q.qlen > 128)
+               skb = skb_reduce_truesize(skb);
        cl = hfsc_classify(skb, sch, &err);
        if (cl == NULL) {
                if (err & __NET_XMIT_BYPASS)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 7bcf20ef9145..40a27392f88e 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -584,6 +584,9 @@ static int htb_enqueue(struct sk_buff *skb, struct
Qdisc *sch,
        struct htb_sched *q = qdisc_priv(sch);
        struct htb_class *cl = htb_classify(skb, sch, &ret);

+       if (sch->q.qlen > 128)
+               skb = skb_reduce_truesize(skb);
+
        if (cl == HTB_DIRECT) {
                /* enqueue to helper queue */
                if (q->direct_queue.qlen < q->direct_qlen) {

On Thu, Aug 22, 2019 at 6:15 AM Dave Taht <dave.taht@gmail.com> wrote:
>
> It's very good to know how much folk have been struggling to keep
> things from OOMing on 32MB platforms. I'd like to hope that the
> unified memory management in cake (vs a collection of QoS qdiscs) and
> the new fq_codel for wifi stuff (cutting it down to 1 alloc from four)
> help, massively on this issue, but until today I was unaware of how
> much the field may have been patching things out.
>
> The default 32MB memory limits in fq_codel comes from the stressing
> about 10GigE networking from google. 4MB is limit in openwrt,
> which is suitable for ~1Gbit, and is sort of there  due to 802.11ac's
> maximum (impossible to hit) of a txop that large.
>
> Something as small as 256K is essentially about 128 full size packets
> (and often, acks from an ethernet device's rx ring eat 2k).
>
> The structure of the new fq_codel for wifi subsystem is "one in the
> hardware, one ready to go, and the rest accumulating". I
> typically see about 13-20 packets in an aggregate. 256k strikes me as
> a bit small.
>
> I haven't checked, but does this patch still exist in openwrt/dd-wrt?
> It had helped a lot when under memory pressure from
> a lot of small packets.
>
> https://github.com/dtaht/cerowrt-3.10/blob/master/target/linux/generic/patches-3.10/657-qdisc_reduce_truesize.patch
>
> Arguably this could be made more aggressive, but it massively reduced
> memory burdens at the time I did it when
> flooding the device, or having lots of acks, and while it cost cpu it
> saved on ooming.
>
> There's two other dubious things in the fq_codel for wifi stack
> presently. Right now the codel target is set too high for p2p use
> (20ms, where 6ms seems more right), and it also flips up to a really
> high target and interval AND turns off ecn when there's more than a
> few stations available (rather than "active") - it's an overly
> conservative figure we used back when we had major issues with
> powersave
> and multicast that I'd hoped we could cut back to normal after we got
> another round of research funding and feedback from the field (which
> didn't happen, and we never got around to making it configurable, and
> being 25x better than it was before seemed "enough")
>
> I was puzzled at battlemesh as to why I had dropping at about 50ms
> delay rather than ecn, and thought it was something
> else, and this morning I'm thinking that folk have been reducing the
> memlimit to 256k rather....



-- 

Dave Täht
CTO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-831-205-9740

  reply	other threads:[~2019-08-22 14:59 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-18 16:33 [Cake] cake in dd-wrt Dave Taht
2019-08-20 12:08 ` Sebastian Gottschall
2019-08-20 16:24   ` Dave Taht
2019-08-20 16:47     ` Sebastian Gottschall
2019-08-20 16:58       ` Toke Høiland-Jørgensen
2019-08-20 17:29         ` Sebastian Gottschall
2019-08-20 17:47           ` Toke Høiland-Jørgensen
2019-08-20 18:10             ` Sebastian Gottschall
2019-08-20 18:31               ` Toke Høiland-Jørgensen
2019-08-20 18:39                 ` Sebastian Gottschall
2019-08-20 18:49                   ` Toke Høiland-Jørgensen
2019-08-21  7:25                     ` Sebastian Gottschall
2019-08-20 19:07                   ` Jonathan Morton
2019-08-20 23:43                     ` Dave Taht
2019-08-21 10:21                       ` Toke Høiland-Jørgensen
2019-08-21 11:03                         ` Sebastian Moeller
2019-08-21 13:10                         ` Dave Taht
2019-08-21 14:52                         ` Jonathan Morton
2019-08-21 15:42                           ` [Cake] pie " Dave Taht
2019-08-21 16:12                             ` Sebastian Gottschall
2019-08-21 16:21                               ` Sebastian Moeller
2019-08-21 16:28                                 ` Sebastian Gottschall
2019-08-21 16:50                                   ` Dave Taht
2019-08-21 21:40                                     ` Toke Høiland-Jørgensen
2019-08-21 21:53                                       ` Dave Taht
2019-08-22  9:18                                         ` Sebastian Gottschall
2019-08-22 13:15                                           ` [Cake] Wifi Memory limits in small platforms Dave Taht
2019-08-22 14:59                                             ` Dave Taht [this message]
2019-08-22 15:48                                             ` Sebastian Gottschall
2019-08-22 17:03                                               ` Dave Taht
2019-08-22 17:37                                                 ` Sebastian Gottschall
2019-08-22 18:23                                                   ` Toke Høiland-Jørgensen
2019-08-22 18:56                                                     ` Dave Taht
2019-08-22 19:37                                                       ` [Cake] [Battlemesh] " Toke Høiland-Jørgensen
2019-08-22 20:10                                                         ` Sebastian Moeller
2019-08-22 20:30                                                       ` [Cake] " Sebastian Gottschall
2019-08-22 23:39                                                         ` Dave Taht
2019-08-23  6:25                                                           ` Sebastian Gottschall
2019-08-23  6:48                                                           ` Sebastian Moeller
2019-08-22 20:32                                                       ` [Cake] fq_codel_fast crash/lockup Sebastian Gottschall
2019-08-21 21:39                                   ` [Cake] pie in dd-wrt Toke Høiland-Jørgensen
2019-08-22  9:17                                     ` Sebastian Gottschall
2019-08-22 10:12                                       ` Toke Høiland-Jørgensen
2019-08-21  7:30                     ` [Cake] cake " Sebastian Gottschall
2019-08-20 18:05       ` Sebastian Gottschall
2019-08-20 23:43         ` Dave Taht
2019-08-20 23:34       ` Dave Taht
2019-08-21  7:44         ` Sebastian Gottschall
2019-08-21  7:44       ` Sebastian Moeller
2019-08-21  7:50         ` Sebastian Gottschall
2019-08-21  7:56           ` Sebastian Moeller
2019-08-21  9:04             ` Sebastian Gottschall
2019-08-21  9:17               ` Sebastian Moeller
2019-08-21 13:20           ` Dave Taht
2019-08-21 16:06             ` Sebastian Gottschall
2019-08-20 18:18 ` Sebastian Gottschall
2019-08-20 23:50   ` Dave Taht
2019-08-21  7:47     ` Sebastian Gottschall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA93jw5pA7JhQD1PL_7XHnOkU-sxxrnF0a7Asmzb+CXW=NMzjQ@mail.gmail.com' \
    --to=dave.taht@gmail.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=dave@taht.net \
    --cc=make-wifi-fast@lists.bufferbloat.net \
    --cc=s.gottschall@newmedia-net.de \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox