linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: Xiao Ni <xni@redhat.com>
Cc: Nigel Croxon <ncroxon@redhat.com>,
	linux-raid <linux-raid@vger.kernel.org>,
	Guoqing Jiang <guoqing.jiang@linux.dev>
Subject: Re: [PATCH v2] md/raid10: Remove rcu_dereference when it doesn't need rcu lock to protect
Date: Thu, 26 Aug 2021 09:18:11 -0700	[thread overview]
Message-ID: <CAPhsuW7dZXX2i-3pBMWX0C5q+RBrmCuMUz=6_KkKYPu3USQBhQ@mail.gmail.com> (raw)
In-Reply-To: <CAPhsuW73qcuf-a=ENW+f3ecb548uL2zHxir7dYixrnz5838gZw@mail.gmail.com>

On Fri, Aug 20, 2021 at 5:31 PM Song Liu <song@kernel.org> wrote:
>
> On Tue, Aug 17, 2021 at 10:58 PM Xiao Ni <xni@redhat.com> wrote:
> >
> > One warning message is triggered like this:
> > [  695.110751] =============================
> > [  695.131439] WARNING: suspicious RCU usage
> > [  695.151389] 4.18.0-319.el8.x86_64+debug #1 Not tainted
> > [  695.174413] -----------------------------
> > [  695.192603] drivers/md/raid10.c:1776 suspicious
> > rcu_dereference_check() usage!
> > [  695.225107] other info that might help us debug this:
> > [  695.260940] rcu_scheduler_active = 2, debug_locks = 1
> > [  695.290157] no locks held by mkfs.xfs/10186.
> >
> > In the first loop of function raid10_handle_discard. It already
> > determines which disk need to handle discard request and add the
> > rdev reference count rdev->nr_pending. So the conf->mirrors will
> > not change until all bios come back from underlayer disks. It
> > doesn't need to use rcu_dereference to get rdev.
> >
> > Fixes: d30588b2731f ('md/raid10: improve raid10 discard request')
> > Signed-off-by: Xiao Ni <xni@redhat.com>
> > Acked-by: Guoqing Jiang <guoqing.jiang@linux.dev>
>
> Applied to md-fixes. Thanks!

Moved to md-next as we are too close to 5.14 release.

Thanks,
Song

      reply	other threads:[~2021-08-26 16:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  5:57 [PATCH v2] md/raid10: Remove rcu_dereference when it doesn't need rcu lock to protect Xiao Ni
2021-08-21  0:31 ` Song Liu
2021-08-26 16:18   ` Song Liu [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='CAPhsuW7dZXX2i-3pBMWX0C5q+RBrmCuMUz=6_KkKYPu3USQBhQ@mail.gmail.com' \
    --to=song@kernel.org \
    --cc=guoqing.jiang@linux.dev \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=xni@redhat.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;
as well as URLs for NNTP newsgroup(s).