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

On Jun 02, 2026 / 11:13, Keith Busch wrote:
> On Sat, May 30, 2026 at 02:20:45PM +0900, Shin'ichiro Kawasaki wrote:
> > -static void nvme_tcp_reclassify_socket(struct socket *sock)
> > +static void nvme_tcp_reclassify_socket(struct nvme_tcp_queue *queue)
> >  {
> > -	struct sock *sk = sock->sk;
> > +	struct sock *sk = queue->sock->sk;
> > +
> > +	lockdep_register_key(&queue->nvme_tcp_sk_key);
> > +	lockdep_register_key(&queue->nvme_tcp_slock_key);
> 
> ...
> 
> > @@ -1468,6 +1473,11 @@ static void nvme_tcp_free_queue(struct nvme_ctrl *nctrl, int qid)
> >  	kfree(queue->pdu);
> >  	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
> >  }
> >  
> >  static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue)
> > @@ -1813,7 +1823,7 @@ 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);
> > +	nvme_tcp_reclassify_socket(queue);
> 
> On a subsequent error in this function, I think you need to call
> lockdep_unregister_key directly in on of the goto error cases since we
> don't call nvme_tcp_free_queue for this failed queue.

Thank you for point it out. lockdep_unregister_key() calls are required in the
error paths. I will add them in v2.


  reply	other threads:[~2026-06-03 11:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-30  5:20 [PATCH 0/2] nvme-tcp: lockdep: use dynamic lockdep keys per socket instance Shin'ichiro Kawasaki
2026-05-30  5:20 ` [PATCH 1/2] nvme-tcp: move nvme_tcp_reclassify_socket() Shin'ichiro Kawasaki
2026-05-31 15:21   ` Nilay Shroff
2026-06-01  7:06   ` Christoph Hellwig
2026-05-30  5:20 ` [PATCH 2/2] nvme-tcp: lockdep: use dynamic lockdep keys per socket instance Shin'ichiro Kawasaki
2026-05-31 15:22   ` Nilay Shroff
2026-06-01  7:06   ` Christoph Hellwig
2026-06-02 10:13   ` Keith Busch
2026-06-03 11:00     ` Shin'ichiro Kawasaki [this message]
2026-06-03  9:44 ` [PATCH 0/2] " Keith Busch
2026-06-03 11:01   ` Shin'ichiro Kawasaki

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=aiAI4v_V63sBrTz6@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