All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH net-next 2/2] net/sched: fq_codel: local packets no longer count against memory limit
Date: Tue, 12 May 2026 20:15:06 +0200	[thread overview]
Message-ID: <87fr3wxzo5.fsf@toke.dk> (raw)
In-Reply-To: <CANn89i+0mw1MRXaWiDfMr1j4dYgot54roxFs8gTMCQYRQVUz9g@mail.gmail.com>

Eric Dumazet <edumazet@google.com> writes:

> On Tue, May 12, 2026 at 5:11 AM Toke Høiland-Jørgensen <toke@toke.dk> wrote:
>>
>> Eric Dumazet <edumazet@google.com> writes:
>>
>> > Commit 95b58430abe7 ("fq_codel: add memory limitation per queue")
>> > claimed that the 32Mb default was "reasonable even for heavy duty usages."
>> >
>> > In practice, this is not the case.
>>
>> Well, the assumption lasted a decade, so that's pretty good? :)
>>
>> > Packets that are associated with local sockets sk_wmem_alloc
>> > do not really need additional memory control.
>> >
>> > Signed-off-by: Eric Dumazet <edumazet@google.com>
>> > ---
>> >  net/sched/sch_fq_codel.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
>> > index 1b1de693d4c64a1f5f4e9e788371829dea91740e..71107dc52be799a14f370f2ad74d2eadd93992c1 100644
>> > --- a/net/sched/sch_fq_codel.c
>> > +++ b/net/sched/sch_fq_codel.c
>> > @@ -212,7 +212,7 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch,
>> >               q->new_flow_count++;
>> >               WRITE_ONCE(flow->deficit, q->quantum);
>> >       }
>> > -     get_codel_cb(skb)->mem_usage = skb->truesize;
>> > +     get_codel_cb(skb)->mem_usage = is_skb_wmem(skb) ? 0 : skb->truesize;
>> >       q->memory_usage += get_codel_cb(skb)->mem_usage;
>>
>> Only one concern here: q->memory_usage is exposed to userspace in the
>> stats, so this will look like the packets queued are zero-length to
>> anyone watching, which may end up confusing folks? Also, there will be
>> no way to see how many bytes are actually in the qdisc.
>
> Standard qdisc stats show the amount of bytes and packets.
>
> None of the other qdiscs seem to care (except cake which copy/pasted fq_codel)

Right, the cake stats was why I asked. Pretty sure there are people who
watch these; but now that you mention it, I may have confused the
standard backlog_bytes stat field with this one...

>> Should we keep a separate counter so we can still accurately report the
>> memory usage to userspace?
>
> Only purpose of mem usage counter was to have an idea of how close of
> the 32Mb limit we were, this is still reported for forwarded packets
> (router workload)
>
> All these counters take precious resources, I would rather not add another one.

Right, fair (and see above). In that case:

Reviewed-by: Toke Høiland-Jørgensen <toke@toke.dk>


  reply	other threads:[~2026-05-12 18:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12  9:48 [PATCH net-next 0/2] net/sched: refine fq_codel memory limits Eric Dumazet
2026-05-12  9:48 ` [PATCH net-next 1/2] net: make is_skb_wmem() available to modules Eric Dumazet
2026-05-12 12:06   ` Toke Høiland-Jørgensen
2026-05-12  9:48 ` [PATCH net-next 2/2] net/sched: fq_codel: local packets no longer count against memory limit Eric Dumazet
2026-05-12 12:11   ` Toke Høiland-Jørgensen
2026-05-12 17:50     ` Eric Dumazet
2026-05-12 18:15       ` Toke Høiland-Jørgensen [this message]
2026-05-14  8:24   ` Paolo Abeni
2026-05-14  8:49     ` Eric Dumazet
2026-05-14  9:00       ` Eric Dumazet
2026-05-14 10:06       ` Paolo Abeni
2026-05-15 22:28         ` Victor Nogueira
2026-05-14  2:30 ` [PATCH net-next 0/2] net/sched: refine fq_codel memory limits patchwork-bot+netdevbpf

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

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

  git send-email \
    --in-reply-to=87fr3wxzo5.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.