Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Nilay Shroff <nilay@linux.ibm.com>
Cc: linux-nvme@lists.infradead.org, Keith Busch <kbusch@kernel.org>,
	 Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	 Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH v2] nvme-tcp: lockdep: use dynamic lockdep keys per socket instance
Date: Thu, 4 Jun 2026 11:26:35 +0900	[thread overview]
Message-ID: <aiDh8DUwDxYdTepv@shinmob> (raw)
In-Reply-To: <34707988-b1be-4ff0-9786-ef02b26eb0de@linux.ibm.com>

On Jun 03, 2026 / 17:49, Nilay Shroff wrote:
> On 6/3/26 4:55 PM, Shin'ichiro Kawasaki wrote:
> >   static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue)
> > @@ -1813,7 +1818,12 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
> >   	}
> >   	sk_net_refcnt_upgrade(queue->sock->sk);
> > -	nvme_tcp_reclassify_socket(queue->sock);
> > +
> > +#ifdef CONFIG_DEBUG_LOCK_ALLOC
> > +	lockdep_register_key(&queue->nvme_tcp_sk_key);
> > +	lockdep_register_key(&queue->nvme_tcp_slock_key);
> > +	nvme_tcp_reclassify_socket(queue);
> > +#endif
> >   	/* Single syn retry */
> >   	tcp_sock_set_syncnt(queue->sock->sk, 1);
> > @@ -1921,6 +1931,11 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
> >   err_destroy_mutex:
> >   	mutex_destroy(&queue->send_mutex);
> >   	mutex_destroy(&queue->queue_lock);
> > +
> > +#ifdef CONFIG_DEBUG_LOCK_ALLOC
> > +	lockdep_unregister_key(&queue->nvme_tcp_sk_key);
> > +	lockdep_unregister_key(&queue->nvme_tcp_slock_key);
> > +#endif
> >   	return ret;
> >   }
> 
> I think we shouldn't call lockdep_unregister_key() from under err_destroy_mutex
> label, and instead it should be moved just before the err_destroy_mutex label.
> The reason being, when the code jumps to err_destroy_mutex label, it hasn't
> yet registered those lockdep keys.

Thanks for pointing it out. I overlooked the label. Will send out v3 moving the
lockdep_unregister_key() calls before the err_destroy_mutex label.


      reply	other threads:[~2026-06-04  2:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03 11:25 [PATCH v2] nvme-tcp: lockdep: use dynamic lockdep keys per socket instance Shin'ichiro Kawasaki
2026-06-03 12:19 ` Nilay Shroff
2026-06-04  2:26   ` Shin'ichiro Kawasaki [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=aiDh8DUwDxYdTepv@shinmob \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nilay@linux.ibm.com \
    --cc=sagi@grimberg.me \
    /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