Linux Kernel Mentees Archive on lore.kernel.org
 help / color / Atom feed
From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
To: Wei Liu <wei.liu@kernel.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	paul@xen.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Joel Fernandes <joel@joelfernandes.org>,
	xen-devel@lists.xenproject.org,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [PATCH] net: xen-netback: hash.c: Use built-in RCU list checking
Date: Wed, 15 Jan 2020 21:17:46 +0530
Message-ID: <CAF65HP3nP1J9U6yBhjf9LqRqXA34ASfNs0gfo+66BhO87WwYAw@mail.gmail.com> (raw)
In-Reply-To: <20200115150545.j5gu7lm3l3ouv7l4@debian>

[-- Attachment #1.1: Type: text/plain, Size: 1520 bytes --]

On Wed, Jan 15, 2020 at 8:35 PM Wei Liu <wei.liu@kernel.org> wrote:

> On Wed, Jan 15, 2020 at 07:48:40PM +0530, madhuparnabhowmik04@gmail.com
> wrote:
> > From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> >
> > list_for_each_entry_rcu has built-in RCU and lock checking.
> > Pass cond argument to list_for_each_entry_rcu.
> >
> > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
>
> You seem to have dropped the second hunk which modified
> xenvif_flush_hash, is that a mistake?
>

I am sorry again, Yes I forgot to add the second hunk.
I will send the final patch with both the hunks in a while.

Thank you,
Madhuparna

Wei.
>
> > ---
> >  drivers/net/xen-netback/hash.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/xen-netback/hash.c
> b/drivers/net/xen-netback/hash.c
> > index 10d580c3dea3..3f9783f70a75 100644
> > --- a/drivers/net/xen-netback/hash.c
> > +++ b/drivers/net/xen-netback/hash.c
> > @@ -51,7 +51,8 @@ static void xenvif_add_hash(struct xenvif *vif, const
> u8 *tag,
> >
> >       found = false;
> >       oldest = NULL;
> > -     list_for_each_entry_rcu(entry, &vif->hash.cache.list, link) {
> > +     list_for_each_entry_rcu(entry, &vif->hash.cache.list, link,
> > +                             lockdep_is_held(&vif->hash.cache.lock)) {
> >               /* Make sure we don't add duplicate entries */
> >               if (entry->len == len &&
> >                   memcmp(entry->tag, tag, len) == 0)
> > --
> > 2.17.1
> >
>

[-- Attachment #1.2: Type: text/html, Size: 2530 bytes --]

<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 15, 2020 at 8:35 PM Wei Liu &lt;<a href="mailto:wei.liu@kernel.org">wei.liu@kernel.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Jan 15, 2020 at 07:48:40PM +0530, <a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a> wrote:<br>
&gt; From: Madhuparna Bhowmik &lt;<a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a>&gt;<br>
&gt; <br>
&gt; list_for_each_entry_rcu has built-in RCU and lock checking.<br>
&gt; Pass cond argument to list_for_each_entry_rcu.<br>
&gt; <br>
&gt; Signed-off-by: Madhuparna Bhowmik &lt;<a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a>&gt;<br>
<br>
You seem to have dropped the second hunk which modified<br>
xenvif_flush_hash, is that a mistake?<br></blockquote><div> </div><div>I am sorry again, Yes I forgot to add the second hunk.</div><div>I will send the final patch with both the hunks in a while.</div><div><br></div><div>Thank you,</div><div>Madhuparna</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Wei.<br>
<br>
&gt; ---<br>
&gt;  drivers/net/xen-netback/hash.c | 3 ++-<br>
&gt;  1 file changed, 2 insertions(+), 1 deletion(-)<br>
&gt; <br>
&gt; diff --git a/drivers/net/xen-netback/hash.c b/drivers/net/xen-netback/hash.c<br>
&gt; index 10d580c3dea3..3f9783f70a75 100644<br>
&gt; --- a/drivers/net/xen-netback/hash.c<br>
&gt; +++ b/drivers/net/xen-netback/hash.c<br>
&gt; @@ -51,7 +51,8 @@ static void xenvif_add_hash(struct xenvif *vif, const u8 *tag,<br>
&gt;  <br>
&gt;       found = false;<br>
&gt;       oldest = NULL;<br>
&gt; -     list_for_each_entry_rcu(entry, &amp;vif-&gt;hash.cache.list, link) {<br>
&gt; +     list_for_each_entry_rcu(entry, &amp;vif-&gt;hash.cache.list, link,<br>
&gt; +                             lockdep_is_held(&amp;vif-&gt;hash.cache.lock)) {<br>
&gt;               /* Make sure we don&#39;t add duplicate entries */<br>
&gt;               if (entry-&gt;len == len &amp;&amp;<br>
&gt;                   memcmp(entry-&gt;tag, tag, len) == 0)<br>
&gt; -- <br>
&gt; 2.17.1<br>
&gt; <br>
</blockquote></div></div>

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 14:18 madhuparnabhowmik04
2020-01-15 15:05 ` Wei Liu
2020-01-15 15:47   ` Madhuparna Bhowmik [this message]
2020-01-15 15:55 madhuparnabhowmik04
2020-01-15 17:41 ` Wei Liu
2020-01-17  9:57 ` David Miller

Reply instructions:

You may reply publically 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=CAF65HP3nP1J9U6yBhjf9LqRqXA34ASfNs0gfo+66BhO87WwYAw@mail.gmail.com \
    --to=madhuparnabhowmik04@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@xen.org \
    --cc=paulmck@kernel.org \
    --cc=wei.liu@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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

Linux Kernel Mentees Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kernel-mentees/0 linux-kernel-mentees/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kernel-mentees linux-kernel-mentees/ https://lore.kernel.org/linux-kernel-mentees \
		linux-kernel-mentees@lists.linuxfoundation.org
	public-inbox-index linux-kernel-mentees

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxfoundation.lists.linux-kernel-mentees


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git