Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5444483ybl; Tue, 14 Jan 2020 09:03:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwXYTYH8Egzu9SeCLiFTkpY3Qx0PHjRZkVT78u3Z3HvBMsprMpf5o6b/32YIKPO9GI6kWbY X-Received: by 2002:a9d:6183:: with SMTP id g3mr17720607otk.304.1579021390207; Tue, 14 Jan 2020 09:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579021390; cv=none; d=google.com; s=arc-20160816; b=GJFG80UFG6uaT+VF8Nl3Fut70VYobE3Da0CgfRmKlzfftllpN/hBKCYtiyai0llgwE Hp+Z9uIJHNnAhzFPVklKC4WJYvie9g2M8ua5uVFW+huBN8N4G8eopRNRHVk5XQjNQAxH mPfGoAwn1rvJn3nWt7nFz/dr6Odn0Ayv2aE+GxkhI8sHsXbX9/gTu4UIvEs+gsLUaU2S 9ocCH2FD1kUmj81SCx/ezpTNrldOn/cPxE4k1r63J0HRvVF98sgUHy3FiDFHXiQfVuop XfoX5xRdFofXrtkRmZ0YVFinAu7BoDTt7SjqeoAbLdkyVtxSYLHVc7Hx1jxI5UmHUXA+ Q2Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=JDu3A6FbxqvQvWiNppv8E/K/yG7HweCwjf1Zbenys+8=; b=YlzFsy5fMZUd8v2jAe8gnWq3izA+F1uTM8CdYGmNw5WwyPmdwlqDCFrncQB6EfGgFo OqGhlxKd5G0oqaBmtbkV46T13eKjKGbtTPtzfR3zVKSYEyS6p9DnI6meQTutCnTguLux vbIf23d99c+EqKRIzZwuTN6zbBnleXn2CuN9SWxUQAALgyi5FJ6gOmEC+jUIbXt0EblE Qi0RROC33G0rI+whhUnZxYBt65y+Qr2w9gVOIZ8vgX30JZm2fjiWpaQzgybAkYzGuAo0 qDUeTY6mEr4Pjz5aj2Qer1d8Kx6sTHkpD/ebrSBb5j69YtbBb8yWzuKsRb1G+5vTxGPP DSzQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si8981270otj.282.2020.01.14.09.02.53; Tue, 14 Jan 2020 09:03:10 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbgANRAh (ORCPT + 99 others); Tue, 14 Jan 2020 12:00:37 -0500 Received: from mga07.intel.com ([134.134.136.100]:62403 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgANRAh (ORCPT ); Tue, 14 Jan 2020 12:00:37 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2020 09:00:36 -0800 X-IronPort-AV: E=Sophos;i="5.70,433,1574150400"; d="scan'208";a="213395849" Received: from ddalessa-mobl.amr.corp.intel.com (HELO [10.254.201.179]) ([10.254.201.179]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Jan 2020 09:00:34 -0800 Subject: Re: [PATCH 1/3] infiniband: hw: hfi1: verbs.c: Use built-in RCU list checking To: Jason Gunthorpe , madhuparnabhowmik04@gmail.com Cc: mike.marciniszyn@intel.com, paulmck@kernel.org, joel@joelfernandes.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, rcu@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200114162345.19995-1-madhuparnabhowmik04@gmail.com> <20200114165740.GB22037@ziepe.ca> From: Dennis Dalessandro Message-ID: <74adec84-ec5b-ea1b-7adf-3f8608838259@intel.com> Date: Tue, 14 Jan 2020 12:00:19 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200114165740.GB22037@ziepe.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/14/2020 11:57 AM, Jason Gunthorpe wrote: > On Tue, Jan 14, 2020 at 09:53:45PM +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 | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c >> index 089e201d7550..22f2d4fd2577 100644 >> +++ b/drivers/infiniband/hw/hfi1/verbs.c >> @@ -515,7 +515,7 @@ 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, lockdep_is_held(&(ibp->rvp.lock))) { > > Okay, this looks reasonable > > Mike, Dennis, is this the right lock to test? > I'm looking at that right now actually, I don't think this is correct. Wanted to talk to Mike before I send a response though. -Denny