Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp651090ybl; Tue, 7 Jan 2020 12:35:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzmJKx3GQo96MNCFDNucowJEdXUzv8kvOBafMIEpOWidwrAUB6c8Slaw++Zh0jjdgjnAh7G X-Received: by 2002:a54:4713:: with SMTP id k19mr209495oik.113.1578429338092; Tue, 07 Jan 2020 12:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578429338; cv=none; d=google.com; s=arc-20160816; b=cm2Iw13ur6xpQtxGoZwvItcx7JcLARzMk7JiUgdyBCeQ/jPZXUpOJ9V9udBDJn2K+K NAlzl1Lxpr1VbNCmAk3o7x4CxedYa8/ciJWw2ZQzBJUnFXmmqkiJ3dfk4f+5xEHY/cgA 0TnneFmt5oFF9rQ2TVwVLnE860U+SPTMgB2SoLbhw4T4wcq3KAiO9m+1y9CUPszgDITv O7K8A6GrEfhgwSEiZYbmzS19+zUU9AWwxmYHYF993S5kv+Eb/UkwRg13JWi2j30PsTNh 302/U8ytQk/Onx3WThnbc45rpPy1gdF0JVVABQu4d/3lbCZSsH007hQR2JBX6NxdVelO V9UQ== 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=3zhpjGKRs5oCN7gE0zJUv09fBYY5DJxxWR8yhyAhckI=; b=mynHLNjacplUJOPAGzXseA0Z92HA9Sq/iYeHAS0pQ7aoeSIoo0Foq0xK6RtW0BgyQH DR3JNXx2aPT4B4bCEOrDM4QV7wU0P2ZLNXNAyUuNtkJtIwZTrGRl7veYkIYf4bV+Ojh/ Onh6YhH0ZI6rZn5t1DI1v5I6Rh0RRPce+qQx1RW/+XgXeYOswm7+qUybIN9pHq2iINIf DLluBTfJvR8CXTh0wOzwhkdtDUBUFc1ufXyHxKPTtkuw9oxm3LXieogZ+9cgXW5QJFxf P4quj0MoPIkK6zyjDLXoWU9ulmUIRVnkbTykhX2MRXDzQOP8vNHjRcatPVGImqJtIEJ5 /RAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=LzfATNAF; 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 q12si646652otr.183.2020.01.07.12.35.24; Tue, 07 Jan 2020 12:35:38 -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=@ziepe.ca header.s=google header.b=LzfATNAF; 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 S1728727AbgAGUd5 (ORCPT + 99 others); Tue, 7 Jan 2020 15:33:57 -0500 Received: from mail-qv1-f67.google.com ([209.85.219.67]:35739 "EHLO mail-qv1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728384AbgAGUd5 (ORCPT ); Tue, 7 Jan 2020 15:33:57 -0500 Received: by mail-qv1-f67.google.com with SMTP id u10so469553qvi.2 for ; Tue, 07 Jan 2020 12:33:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3zhpjGKRs5oCN7gE0zJUv09fBYY5DJxxWR8yhyAhckI=; b=LzfATNAFVRCE8SAl1d6Ctk4/lJ3RQSwN2ruwf6LC27wA411ljbwylPEOr6fqE9gRJK /aW3Q/ojQqDrhd3inOEO0hHNcy6SAQJ1vTsbc9lFG5jVP3pvqSdDSaU8Pa5owAqvBU8B luGS4iid5TYnlqBU3ecv9aw61bsN9ZpBz3F+DDSVAdrPb4wNO92hWHqqoQxhrBdpv5Ph oPrKDojhIIATLeooNxbXC9kMnsP5qZA1e90aV/Tz4jgc5sIqaT9AIJXuDHRgZ+XbpjTv +nk4SnEi+FeRmci7r55ERdAASdZgPpAY02r9b46vZe0iLEDR3Xge2WCmwVarMRF8iPmL g1JQ== 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=3zhpjGKRs5oCN7gE0zJUv09fBYY5DJxxWR8yhyAhckI=; b=GxfriBa9LKz3BuGlKA7z1HbK3c6uuOLePXbLv8BXK2crJjKBaVQ9UBhOpSkna5wmcm Alo5jf3vSfk/Tek1OVJj4q7ltse3NH4Cohe5uJs7ktn1RvRm6dx9vmUocqfCT1J2KtST DVNUhaEmiUxc7mWuzNc5Z6MK1kDgbv1TAYntlmSrn98bPn1rPQy90iH1TMtXmAq+cDo3 K64TGycmF/q3I6J60t+XUOhlSDhzz0Zgla0VFeFISH2TOAaGGnxeBPTaFTNebbP3zUFs 1XXZkSrd1K97vkkLTuXHVi0T+BmmcYxADU7FcYVufHhGyPVLooV4HRQegh6W0vdIhEuV JGUA== X-Gm-Message-State: APjAAAXlo0l+HtOeZ79rKeQsQGF/wWbwbrZjzGQiqZpJZ5qKn6TpaVqq uBWNzamfxSg18IXv8b+RJOHkVw== X-Received: by 2002:a05:6214:1150:: with SMTP id b16mr1181882qvt.71.1578429235967; Tue, 07 Jan 2020 12:33:55 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id i28sm446729qtc.57.2020.01.07.12.33.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jan 2020 12:33:55 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iovY2-0001Xd-Ue; Tue, 07 Jan 2020 16:33:54 -0400 Date: Tue, 7 Jan 2020 16:33:54 -0400 From: Jason Gunthorpe To: madhuparnabhowmik04@gmail.com Cc: dennis.dalessandro@intel.com, mike.marciniszyn@intel.com, dledford@redhat.com, paulmck@kernel.org, rcu@vger.kernel.org, joel@joelfernandes.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: <20200107203354.GD26174@ziepe.ca> References: <20200107192912.22691-1-madhuparnabhowmik04@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200107192912.22691-1-madhuparnabhowmik04@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) 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 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? Jason