From: Davide Caratti <dcaratti@redhat.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net/sched: don't use dynamic lockdep keys with clsact/ingress/noqueue
Date: Mon, 2 Feb 2026 16:08:23 +0100 [thread overview]
Message-ID: <aYC952E_49Se6MOA@dcaratti.users.ipa.redhat.com> (raw)
In-Reply-To: <20260130192921.1fbf5e21@kernel.org>
On Fri, Jan 30, 2026 at 07:29:21PM -0800, Jakub Kicinski wrote:
> On Thu, 29 Jan 2026 16:24:35 +0100 Davide Caratti wrote:
> > +static inline void qdisc_lock_init(struct Qdisc *sch, const struct Qdisc_ops *ops)
>
> wrap at 80 please
hi Jakub, thanks for reading. Sure, will fix in v2.
> > +{
> > + bool skip_dynamic_key = (ops->static_flags & TCQ_F_INGRESS) ||
> > + (ops == &noqueue_qdisc_ops);
> > +
> > + if (!skip_dynamic_key)
> > + lockdep_register_key(&sch->root_lock_key);
> > +
> > + spin_lock_init(&sch->q.lock);
> > + if (!skip_dynamic_key)
> > + lockdep_set_class(&sch->q.lock, &sch->root_lock_key);
>
> is there a reason for the order of things here?
I was self-convinced that CONFIG_DEBUG_SPINLOCK and similar would
complain with the ordering below, but I'm now seeing empirically
that it doesn't.
> The code flow would be far more natural with:
>
> {
> spin_lock_init(&sch->q.lock);
>
> /* Skip dynamic keys for qdiscs which can't nest */
> if (ops->static_flags & TCQ_F_INGRESS ||
> ops == &noqueue_qdisc_ops)
> return;
>
> lockdep_register_key(&sch->root_lock_key);
> lockdep_set_class(&sch->q.lock, &sch->root_lock_key);
> }
will do some additional tests and re-send this way if it doesn't
complain.
--
davide
prev parent reply other threads:[~2026-02-02 15:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 15:24 [PATCH net-next] net/sched: don't use dynamic lockdep keys with clsact/ingress/noqueue Davide Caratti
2026-01-31 3:29 ` Jakub Kicinski
2026-02-02 15:08 ` Davide Caratti [this message]
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=aYC952E_49Se6MOA@dcaratti.users.ipa.redhat.com \
--to=dcaratti@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.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 \
--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