public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Davide Caratti <dcaratti@redhat.com>
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: Fri, 30 Jan 2026 19:29:21 -0800	[thread overview]
Message-ID: <20260130192921.1fbf5e21@kernel.org> (raw)
In-Reply-To: <68f55cee98e5402af2509f1d3873fbc7a27f67e9.1769699825.git.dcaratti@redhat.com>

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

> +{
> +	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? 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);
}

> +}
> +
> +static inline void qdisc_lock_uninit(struct Qdisc *sch, const struct Qdisc_ops *ops)
> +{
> +	bool skip_dynamic_key = (ops->static_flags & TCQ_F_INGRESS) ||
> +				(ops == &noqueue_qdisc_ops);
> +
> +	if (!skip_dynamic_key)
> +		lockdep_unregister_key(&sch->root_lock_key);
-- 
pw-bot: cr

  reply	other threads:[~2026-01-31  3:29 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 [this message]
2026-02-02 15:08   ` Davide Caratti

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=20260130192921.1fbf5e21@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --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