Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: "Toke Høiland-Jørgensen" <toke@toke.dk>,
	"Jamal Hadi Salim" <jhs@mojatatu.com>,
	"Cong Wang" <xiyou.wangcong@gmail.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Simon Horman" <horms@kernel.org>,
	cake@lists.bufferbloat.net, netdev@vger.kernel.org
Subject: [Cake] Re: [PATCH net-next] net/sched: cake: avoid separate allocation of struct cake_sched_config
Date: Wed, 14 Jan 2026 08:58:22 +0100	[thread overview]
Message-ID: <CANn89iLdM=a=oagYA=LKbfaDuhQaYtxA0wNERuzNLGghA58Phw@mail.gmail.com> (raw)
In-Reply-To: <20260113143157.2581680-1-toke@redhat.com>

On Tue, Jan 13, 2026 at 3:32 PM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>
> Paolo pointed out that we can avoid separately allocating struct
> cake_sched_config even in the non-mq case, by embedding it into struct
> cake_sched_data. This reduces the complexity of the logic that swaps the
> pointers and frees the old value, at the cost of adding 56 bytes to the
> latter. Since cake_sched_data is already almost 17k bytes, this seems
> like a reasonable tradeoff.
>
> Suggested-by: Paolo Abeni <pabeni@redhat.com>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> ---

This is also fixing a panic, so :

Fixes: bc0ce2bad36c ("net/sched: sch_cake: Factor out config variables
into separate struct")

For the record, a fix for the panic would be :

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index e30ef7f8ee6862a916acc06e568e37f35fd675b1..742fb850e2afb159f215b263bc36c372552911bc
100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -2825,6 +2825,8 @@ static int cake_init(struct Qdisc *sch, struct
nlattr *opt,
        struct cake_sched_config *q;
        int i, j, err;

+       qdisc_watchdog_init(&qd->watchdog, sch);
+
        q = kzalloc(sizeof(*q), GFP_KERNEL);
        if (!q)
                return -ENOMEM;
@@ -2838,7 +2840,6 @@ static int cake_init(struct Qdisc *sch, struct
nlattr *opt,
        qd->cur_flow  = 0;
        qd->config = q;

-       qdisc_watchdog_init(&qd->watchdog, sch);

        if (opt) {
                err = cake_change(sch, opt, extack);

  reply	other threads:[~2026-01-14  7:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 14:31 [Cake] [PATCH net-next] net/sched: cake: avoid separate allocation of struct cake_sched_config Toke Høiland-Jørgensen
2026-01-14  7:58 ` Eric Dumazet [this message]
2026-01-14 10:54   ` [Cake] " Toke Høiland-Jørgensen
2026-01-19 14:19 ` 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

  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='CANn89iLdM=a=oagYA=LKbfaDuhQaYtxA0wNERuzNLGghA58Phw@mail.gmail.com' \
    --to=edumazet@google.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=davem@davemloft.net \
    --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 \
    --cc=toke@redhat.com \
    --cc=toke@toke.dk \
    --cc=xiyou.wangcong@gmail.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