Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp858899ybl; Fri, 10 Jan 2020 07:55:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyS9gIZ/KxXbiTToTSK6yxageHUOhV0AFZswJ1odCVPdH3b16NAlRgEMEN22ffuArJiW7Nn X-Received: by 2002:a05:6808:197:: with SMTP id w23mr2828195oic.46.1578671723704; Fri, 10 Jan 2020 07:55:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578671723; cv=none; d=google.com; s=arc-20160816; b=oIms7Oy/WGK7pgqvRBbsToWSd195PuKc2Zs8+zF2EdjW0WQoquWyxjFpMXJmCPd2rE L2VZvVmgFsxY7z7WAMe127Hh8JvJ4qttRqSLH8iykU2f8fqU71oi4caA75lZobIkJHFm BOVdhylT5r5rCYG3qHPzwieaKKWwwe8c23emwdI/YHk+CvW3nrWaeWIT71VsFc7bGst/ T2jbQmCFU57QrbJapK988zekH0ab49341OaQxoll1tvohLaQGj1F/mmzd8bTwGhvemui IUm/KLGWyIC2GwrVnDmtTuwjsdpVzkcGQbshHonvc1WkK9oUcliFIMdZveQtpBN5F/+K Y1BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SK9SfM0s44elgGzLaJeFK5jMx7NIcHCDZF3x9nv0Lxs=; b=CzAlxM5NKuUZtYJet7Ukx/gAgaTtbi1VKxtoJpSb8d9RsN1ajv9CfOoFYUO/limnpA mc5PkeyRrXqMKWOJy8MJEvFOS2nSQ/ie9kC45hpLNbuJq9m/Q+dGuh6csAR6So6d7hCY GKmooNMF/HweTiRuE1NYMArA/ZnCh4ju0Hd6aZGX8vIWy8W5+499MgThheYcSHLYgacS CAO/31FGVx1WM3ayBUUH2iF/YiUUoerPhHaaueamkpfT2WJtidE5SRiUge3vW/CgzRcM No3A1j+SC0Xv+io6gBSSLoL79vTBAXKu/0U4GpOLwYSJT3lR2Qob79foZPOQ1y7pvOGv l63A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=aBV1vy75; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si1609444otp.13.2020.01.10.07.55.12; Fri, 10 Jan 2020 07:55:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=aBV1vy75; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728487AbgAJPyM (ORCPT + 99 others); Fri, 10 Jan 2020 10:54:12 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39452 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728391AbgAJPyL (ORCPT ); Fri, 10 Jan 2020 10:54:11 -0500 Received: by mail-pf1-f196.google.com with SMTP id q10so1328606pfs.6 for ; Fri, 10 Jan 2020 07:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SK9SfM0s44elgGzLaJeFK5jMx7NIcHCDZF3x9nv0Lxs=; b=aBV1vy75sNaosplHJ4H3qazVSebNElcAVlUb+HrjOZPq1vvWoFf9dEImAwbKzRGAey WXFZW3qa2v84cafmXiduuTXYX7tiAt38D7DQCWgB/pNRtn4obYWkC9IU5eWvee8iLkNT whWf5etBpitExpwXzzboEVpBB0lB6AIMlr6bM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SK9SfM0s44elgGzLaJeFK5jMx7NIcHCDZF3x9nv0Lxs=; b=pq5ZPSfbzpypuFFWisGOTTPNRJDEMtUThzMrjZLzMlNHazbFBmr2+a4nT9vH3ITuop UN5ZQIQi14mo1Q0y5iTxz7rBq2J3CYwnIJytbPoj4d0AlQ9aNRkztrX6taXHRXrogs6y zhicela/qtp6T1ovXMJCTgydJfxdSiCJrhRTA4zyR2aDiuy9tIYWVFGP4XdzO0OEOlAC RuqQOJcG/2OueY0Mg1f8uAODCtZPNy5ZBbDakXthkEP9RE0B8Pg1B7qVOLmcZdKH/VFD brAiApuZ/wjSrFeSejwRaftz/CinPIt8kIYxONULsvlDa1aKhoPJK7yXr4g2vH7nXj/L hPmg== X-Gm-Message-State: APjAAAVoMSAnMOxWR50LcnvXRIuIma1wPOqcfiXZraDhynnNKjCQla46 lFZDjFTHsi9vcSBlx3nl2JOv4A== X-Received: by 2002:a63:541e:: with SMTP id i30mr5002051pgb.183.1578671649500; Fri, 10 Jan 2020 07:54:09 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id w6sm3769223pfq.99.2020.01.10.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 07:54:08 -0800 (PST) Date: Fri, 10 Jan 2020 10:54:07 -0500 From: Joel Fernandes To: madhuparnabhowmik04@gmail.com Cc: jgg@ziepe.ca, dennis.dalessandro@intel.com, mike.marciniszyn@intel.com, dledford@redhat.com, paulmck@kernel.org, rcu@vger.kernel.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] infiniband: hw: hfi1: verbs.c: Use built-in RCU list checking Message-ID: <20200110155407.GB128013@google.com> References: <20200107192912.22691-1-madhuparnabhowmik04@gmail.com> <20200107203354.GD26174@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200107203354.GD26174@ziepe.ca> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 08, 2020 at 01:35:07PM +0530, madhuparnabhowmik04@gmail.com wrote: > From: Jason Gunthorpe > > On Wed, Jan 08, 2020 at 12:59:12AM +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 > > drivers/infiniband/hw/hfi1/verbs.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c > > index 089e201d7550..e6abdbcb4ffb 100644 > > +++ b/drivers/infiniband/hw/hfi1/verbs.c > > @@ -515,7 +515,8 @@ static inline void hfi1_handle_packet(struct hfi1_packet *packet, > > opa_get_lid(packet->dlid, 9B)); > > if (!mcast) > > goto drop; > > - list_for_each_entry_rcu(p, &mcast->qp_list, list) { > > + list_for_each_entry_rcu(p, &mcast->qp_list, list, > > + lock_is_held(&(ibp->rvp.lock).dep_map)) { > > Why .dep_map? Does this compile? Yeah, have you really compiled this? Don't send patches without at least compile testing !! > Alternatively, it can be lockdep_is_held(ibp->rvp.lock). > Please refer to the macro(link below) and let me know if the usage of lock_is_held() > in the patch is correct. > > https://elixir.bootlin.com/linux/v5.5-rc2/source/include/linux/lockdep.h#L364 Please use lockdep_is_held(). Thanks. thanks, - Joel > > Thanks, > Madhuparna > Jason