From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A062C33CB3 for ; Wed, 15 Jan 2020 15:48:13 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E45472072B for ; Wed, 15 Jan 2020 15:48:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="usbrjaHT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E45472072B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irktj-0008QQ-Jj; Wed, 15 Jan 2020 15:47:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irkti-0008QL-M5 for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 15:47:58 +0000 X-Inumbo-ID: 66ed1aa6-37ae-11ea-b89f-bc764e2007e4 Received: from mail-ot1-x341.google.com (unknown [2607:f8b0:4864:20::341]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 66ed1aa6-37ae-11ea-b89f-bc764e2007e4; Wed, 15 Jan 2020 15:47:58 +0000 (UTC) Received: by mail-ot1-x341.google.com with SMTP id b18so16524289otp.0 for ; Wed, 15 Jan 2020 07:47:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ilVXlccIzQKwAZB4Z6h6iuKbcrKSnYqM64tYSFmmHT0=; b=usbrjaHTxYyp00JfyzM3KR6KLIDz0nAnhdxjs6vH3azZpp3o6+ErwcXDq0AIVyFWOB idRZbrmEEe1fm9JoMlnt016ivdhXc8qzYyTIpPK7J2fLJralhgOpVatnfiwuhxfdOEAs DiPWxAom0wNJWBrum47YEezYGmp3iRnsiXpr9JvE4K7Zq9AVS26Tn1g+NurE4zCXwct1 sYSejHPw5fRNFAJ8FPEkAQ4P4GWmXfcUTc+tjWdRT3vzNM4P7rQh+LJ2XYBaDLXJp6RK ko5MHSTax/z4ktCK9o3E6VNBueObnuVw6FJmC16JHORKxQ9rv4HUDdseGQ5CzZSKtk5+ oSVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ilVXlccIzQKwAZB4Z6h6iuKbcrKSnYqM64tYSFmmHT0=; b=scDLgBonRzZW4yD40wdGdocFs5aTbYmchqvoi0T9gVeuw/cW9wfbJGKhJSDgF21ap4 zxXGywANNr3HxkC1UTSdNLlXO7+s0Lot87ER76MLz4qlN2gH03dm87+g61h2+ORcgNMa p1uY6MCquSP1Gce9e8EDgIEht7L4ku/hvWPYL82fQV8oHP9CQms05MfI7SDxzt8+18rJ h3DeMffh75YAIXM1w5q8p/vIKJpVu/gdTmppJqaha/9Tdvgeso+pZoTm/+iL+pGSmTkN f4Wc+RZe1B1W5A+D/0T8kL4dI2e7XZALLBF5M76O2C4xmnPsLu0AQHON5z5P03xOAvss DFWw== X-Gm-Message-State: APjAAAXhAXpiXB+I9fMHU7ZG1SO7g0uWcHVNh934ryWwOCjIPW5bIMF/ goc/ZW1HhKi4bJFhlhKv+vl9cLuaoSrfaVPgus8= X-Google-Smtp-Source: APXvYqzYBAceFg/OddEAdGD0tzP9ldtUOajIec7RUFyS4DHU4xpXu9K+ET09n64mXTNpZ/Gv1ROQd5F5Y8QHj/KEh4o= X-Received: by 2002:a05:6830:1141:: with SMTP id x1mr3238772otq.120.1579103277426; Wed, 15 Jan 2020 07:47:57 -0800 (PST) MIME-Version: 1.0 References: <20200115141840.10553-1-madhuparnabhowmik04@gmail.com> <20200115150545.j5gu7lm3l3ouv7l4@debian> In-Reply-To: <20200115150545.j5gu7lm3l3ouv7l4@debian> From: Madhuparna Bhowmik Date: Wed, 15 Jan 2020 21:17:46 +0530 Message-ID: To: Wei Liu Subject: Re: [Xen-devel] [PATCH] net: xen-netback: hash.c: Use built-in RCU list checking X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: "Paul E. McKenney" , paul@xen.org, netdev@vger.kernel.org, Amol Grover , linux-kernel@vger.kernel.org, Joel Fernandes , xen-devel@lists.xenproject.org, linux-kernel-mentees@lists.linuxfoundation.org Content-Type: multipart/mixed; boundary="===============4395192034003002212==" Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" --===============4395192034003002212== Content-Type: multipart/alternative; boundary="000000000000ea2d81059c2fa183" --000000000000ea2d81059c2fa183 Content-Type: text/plain; charset="UTF-8" On Wed, Jan 15, 2020 at 8:35 PM Wei Liu wrote: > On Wed, Jan 15, 2020 at 07:48:40PM +0530, madhuparnabhowmik04@gmail.com > wrote: > > From: Madhuparna Bhowmik > > > > 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 > > 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 > > > --000000000000ea2d81059c2fa183 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Jan 15, 2020 at 8:35 PM Wei L= iu <wei.liu@kernel.org> wro= te:
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?
=C2=A0
I am sorry again, Yes I forgot to add the second hunk.
I will se= nd the final patch with both the hunks in a while.

Thank you,
Madhuparna

Wei.

> ---
>=C2=A0 drivers/net/xen-netback/hash.c | 3 ++-
>=C2=A0 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, cons= t u8 *tag,
>=C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0found =3D false;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0oldest =3D NULL;
> -=C2=A0 =C2=A0 =C2=A0list_for_each_entry_rcu(entry, &vif->hash.= cache.list, link) {
> +=C2=A0 =C2=A0 =C2=A0list_for_each_entry_rcu(entry, &vif->hash.= cache.list, link,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lockdep_is_held(&vif->hash.cache.= lock)) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Make sure we = don't add duplicate entries */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (entry->le= n =3D=3D len &&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0me= mcmp(entry->tag, tag, len) =3D=3D 0)
> --
> 2.17.1
>
--000000000000ea2d81059c2fa183-- --===============4395192034003002212== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcKaHR0cHM6Ly9saXN0 cy54ZW5wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3hlbi1kZXZlbA== --===============4395192034003002212==--