Subject: Re: [PATCH net-next] net/sched: cake: avoid separate allocation of struct cake_sched_config

From: Toke Høiland-Jørgensen <[email-masked]>
Date: Wed, 14 Jan 2026 11:54:12 +0100

Eric Dumazet <[email-masked]> writes:

> On Tue, Jan 13, 2026 at 3:32 PM Toke Høiland-Jørgensen <[email-masked]> 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 <[email-masked]>
>> Signed-off-by: Toke Høiland-Jørgensen <[email-masked]>
>> ---
>
> 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 :

Ah yes, of course; thanks for noticing (and for the tag)!

-Toke