[Cake] cake memory consumption

Toke Høiland-Jørgensen toke at redhat.com
Tue Sep 17 05:40:23 EDT 2019


Sebastian Gottschall <s.gottschall at newmedia-net.de> writes:

> more simple patch
>
> --- sch_cake.c  (revision 41051)
> +++ sch_cake.c  (working copy)
> @@ -2691,7 +2691,7 @@
>                  do_div(t, USEC_PER_SEC / 4);
>                  q->buffer_limit = max_t(u32, t, 4U << 20);
>          } else {
> -               q->buffer_limit = ~0;
> +               q->buffer_limit = 4U << 20;
>          }
>
>          sch->flags &= ~TCQ_F_CAN_BYPASS;

As Jonathan remarked, the right thing to do here is to use the
memory_limit parameter to set a different limit when you setup the tree.

Still, I count 35 instances of CAKE in your setup; even with a 4MB limit
apiece, that is a total of 140 MB of potential packet memory. You'd need
to set it as low as 1 or 2 MB to be completely sure that you won't run
out of memory if they are all full...

-Toke


More information about the Cake mailing list