From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
To: Sven Eckelmann <sven@narfation.org>
Cc: madhuparnabhowmik10@gmail.com, mareklindner@neomailbox.ch,
sw@simonwunderlich.de, a@unstable.cc, davem@davemloft.net,
b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, joel@joelfernandes.org,
frextrite@gmail.com,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] net: batman-adv: Use built-in RCU list checking
Date: Sun, 16 Feb 2020 21:03:24 +0530 [thread overview]
Message-ID: <20200216153324.GA4542@madhuparna-HP-Notebook> (raw)
In-Reply-To: <3655191.udZcvKk8tv@sven-edge>
On Sun, Feb 16, 2020 at 04:22:51PM +0100, Sven Eckelmann wrote:
> On Sunday, 16 February 2020 15:47:18 CET madhuparnabhowmik10@gmail.com wrote:
> > From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >
> > hlist_for_each_entry_rcu() has built-in RCU and lock checking.
> >
> > Pass cond argument to hlist_for_each_entry_rcu() to silence
> > false lockdep warnings when CONFIG_PROVE_RCU_LIST is enabled
> > by default.
> >
> > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> > ---
> > net/batman-adv/translation-table.c | 12 ++++++++----
> > 1 file changed, 8 insertions(+), 4 deletions(-)
>
> Added with alignment and line length codingstyle fixes [1].
>
> Can you tell us how you've identified these four hlist_for_each_entry_rcu?
>
Hi Sven,
Thank you for the fixes.
The other hlist_for_each_entry_rcu() are used under the protection of
rcu_read_lock(). We only need to pass the cond when
hlist_for_each_entry_rcu() is used under a
different lock (not under rcu_red_lock()) because according to the current scheme a lockdep splat
is generated when hlist_for_each_entry_rcu() is used outside of
rcu_read_lock() or the lockdep condition (the cond argument) evaluates
to false. So, we need to pass this cond when it is used under the
protection of spinlock or mutex etc. and not required if rcu_read_lock()
is used.
Thank you,
Madhuparna
> Thanks,
> Sven
>
> [1] https://git.open-mesh.org/linux-merge.git/commit/967709ec53a07d1bccbc3716f7e979d3103bd7c5
next prev parent reply other threads:[~2020-02-16 15:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-16 14:47 [PATCH] net: batman-adv: Use built-in RCU list checking madhuparnabhowmik10
2020-02-16 15:22 ` Sven Eckelmann
2020-02-16 15:33 ` Madhuparna Bhowmik [this message]
2020-02-16 15:35 ` Sven Eckelmann
2020-02-16 15:52 ` Madhuparna Bhowmik
2020-02-16 16:17 ` Sven Eckelmann
2020-02-17 12:05 ` Madhuparna Bhowmik
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=20200216153324.GA4542@madhuparna-HP-Notebook \
--to=madhuparnabhowmik10@gmail.com \
--cc=a@unstable.cc \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=davem@davemloft.net \
--cc=frextrite@gmail.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mareklindner@neomailbox.ch \
--cc=netdev@vger.kernel.org \
--cc=sven@narfation.org \
--cc=sw@simonwunderlich.de \
/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