* [Cake] Re: [PATCH net] net/sched: sch_cake: use rcu_dereference_bh() in the cake_mq sync loop
[not found] <179549599115.54577.5943710312861930188@gmail.com>
@ 2026-11-24 10:52 ` Toke Høiland-Jørgensen
0 siblings, 0 replies; only message in thread
From: Toke Høiland-Jørgensen @ 2026-11-24 10:52 UTC (permalink / raw)
To: Kyuwon Cho
Cc: Jonas Köppeler, Jamal Hadi Salim, Jiri Pirko,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Willem de Bruijn, Simon Horman, cake, netdev, linux-kernel
Kyuwon Cho <kyuwoncho18@gmail.com> writes:
> cake_dequeue() reads the other cake_mq sub-qdiscs with rcu_dereference(),
> but it runs from __qdisc_run() under rcu_read_lock_bh() or in softirq
> context, not under rcu_read_lock(), so lockdep warns:
>
> WARNING: suspicious RCU usage
> net/sched/sch_cake.c:2039 suspicious rcu_dereference_check() usage!
> 2 locks held by test/114:
> #0: ffffffff88b2ca80 (rcu_read_lock_bh){....}-{1:3}, at: __dev_queue_xmit (net/core/dev.c:5014)
> #1: ff11000013ec8170 (&sch->root_lock_key){+...}-{3:3}, at: __dev_queue_xmit (net/core/dev.c:5058)
> Call Trace:
> cake_dequeue (net/sched/sch_cake.c:2039)
> __qdisc_run (net/sched/sch_generic.c:359)
> __dev_queue_xmit (net/core/dev.c:4502)
> packet_sendmsg (net/packet/af_packet.c:3157)
>
> A BH-disabled section is an RCU read-side critical section, so only the
> annotation is wrong. Use rcu_dereference_bh(), as cake_classify() does
> for the filter list.
>
> Fixes: 1bddd758bac2 ("net/sched: sch_cake: share shaper state across sub-instances of cake_mq")
> Signed-off-by: Kyuwon Cho <kyuwoncho18@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
^ permalink raw reply [flat|nested] only message in thread