Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Breno Leitao <leitao@debian.org>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH] nvme/host: Fix RCU list traversal to use SRCU primitive
Date: Mon, 4 Nov 2024 14:16:52 +0100	[thread overview]
Message-ID: <20241104131652.GB14373@lst.de> (raw)
In-Reply-To: <20241104-nvme_rcu-v1-1-ecb19f5c95fa@debian.org>

On Mon, Nov 04, 2024 at 04:24:40AM -0800, Breno Leitao wrote:
> The code currently uses list_for_each_entry_rcu() while holding an SRCU
> lock, triggering false positive warnings with CONFIG_PROVE_RCU=y
> enabled:
> 
>   drivers/nvme/host/core.c:3770 RCU-list traversed in non-reader section!!
> 
> While the list is properly protected by SRCU lock, the code uses the wrong
> list traversal primitive. Replace list_for_each_entry_rcu() with
> list_for_each_entry_srcu() to correctly indicate SRCU-based protection
> and eliminate the false warning.

I didn't even know there was such as thing as list_for_each_entry_srcu,
but apparently it's been there for a while.  Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

> Something similar will need to be done for multipath. I will get it done
> once I get some feedback about this patch first.

Thanks!



  reply	other threads:[~2024-11-04 13:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04 12:24 [PATCH] nvme/host: Fix RCU list traversal to use SRCU primitive Breno Leitao
2024-11-04 13:16 ` Christoph Hellwig [this message]
2024-11-04 21:26   ` Keith Busch

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=20241104131652.GB14373@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --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