Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5439434ybl; Tue, 14 Jan 2020 08:58:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyHu23DOQbcICJIUD5AC2UGvFjFECmf0Vi9GOJCMsvcej0pqFxledk7Jku0nAIqcrpRkD8p X-Received: by 2002:a9d:74c8:: with SMTP id a8mr16592211otl.57.1579021130348; Tue, 14 Jan 2020 08:58:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579021130; cv=none; d=google.com; s=arc-20160816; b=jkbn/a567v84JcBuTvEvRCN15mC5G1/Y+8Hsu0X6T6kpVkbmoXl1lOQzA/zVNwAP/A hUkbTk3ppRlkXbA+iS8YP68n0dA1nDXPknyWmkrvlnwRmtdKaGMfuSJoKDhlNjz8koUs E7Lveup5htJoyWd/M2Zc04sU974/SaGzYIJpRAx4gQr4SoAUoB4DsUO8v5FYJik0KmiN sKP3hMeAKk0PSigJJXbGkjDSNEhIBC+rPpqEuCI/CkM9JdL8GifkQY7uuzPXy+53J9rN OJcD/FMCrWQcTHpvzza06dglsrI2KoFSTz6FLaLUv39cD886wC2o1hT4nLHagmXp+Wsn Jqvw== 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=R4InSAKuZ5aCK6QR9Y31K9i3lSVfiJudcKWrhEMNHDc=; b=ASc1wNcTdzWmzSbWTNJnKEPt6rYhLFSlwFDLaJ1vkaU52Jk20gdyeuksr8oPiVarFq ORK/vyVnju18JWyDxwT+2RZiaVRNCLYBC28VLPgJ8obs+qN2m0J+xyu8MB3YA11rSZnP 603Xi4hyPMrUrqcNeNIOeXdrE2D28K+M2kVkSlJ1GcDj+Ttv9vynwvx2VC8ozHFMi/8J uMpPTpE9qPccXo0WBNDLF9IhwaZ03WfXK6Goin9rwCslxhoCL0ZvsNkYkiJ0Fyum7Flp vk+XrQZjfiCFltag3dXWp+MTGgdl3FMWRir48JP+OcmhTfsPiNjVCN/etIPNfsoGR+qd pN1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=XTiJWkcP; 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 h22si9274034otk.18.2020.01.14.08.58.38; Tue, 14 Jan 2020 08:58:50 -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=XTiJWkcP; 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 S1726053AbgANQ5n (ORCPT + 99 others); Tue, 14 Jan 2020 11:57:43 -0500 Received: from mail-qv1-f66.google.com ([209.85.219.66]:45898 "EHLO mail-qv1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726195AbgANQ5m (ORCPT ); Tue, 14 Jan 2020 11:57:42 -0500 Received: by mail-qv1-f66.google.com with SMTP id l14so5968246qvu.12 for ; Tue, 14 Jan 2020 08:57:42 -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=R4InSAKuZ5aCK6QR9Y31K9i3lSVfiJudcKWrhEMNHDc=; b=XTiJWkcP0CtYyjzpFYIsdheUjlKBCgS/2w+rJ6OzGCRSJQhoTM3fQPNtiylHKjRsUx ayrC2dfUPa3VHxwXtXRAfyuvl5IzL+Clvwtq9p5vFydeY08ncMvtJVlB2PIhe1Cr/Vxv DjZgNqeXb4lAgJNIfthyvvgBbP5uaC7dd9oRB4BrVhPE3xX7sATluJtjrCp3PwSdUUoh v++u0APj+AaMOwdR3P4C+tYqR1iVvC+ZimG54pzqKaU8TmJ6OcvkixJgzhq+fEJjJ+5D JUg1ZiQTPSazNN7A6pMwjLwBMZkHicU2mpVIpCH4LnOO/G9OWeZHvoORlWe2FiaeMlFF rKJg== 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=R4InSAKuZ5aCK6QR9Y31K9i3lSVfiJudcKWrhEMNHDc=; b=TXHycka1oVh0N5xLWJHta4T8D/WWboK3VGqp1ftj6/x/DmmhtJV3giVyDpnnVI4idc L5cBdKrxGtYtDxHi32H0NrDCMDOiAUs4nElqsgeSR2WPJOC7QQ+YOJvKzkvS1I12W6BJ ZCoUg494wajlZW2F82j7VJbQAsZi91s0FJ0CUQONeA5Fvj8Z4klS4kstV6FwlALYc1Eb BK8yXwPn3GbxeiMJME2WEdIJ8ebVhUJ+Z5xYLmsBoUEJAwDF8w5V5W+D2dktB51KPX1q xVOv9aEEQ5NfS5OODr6UzMITHNO5W4lfJyDCWmLz7cQrm0Ty0e6aO2gRkLIppkYNSL8D V3eg== X-Gm-Message-State: APjAAAXjMJ2Bdx1hfkf0KGK6obnbAxu+yRy6TiESeHSB9lOAMJF+3qeh Az+BWnMmJkXYpQsC+LBLQ9ityA== X-Received: by 2002:a0c:fe8d:: with SMTP id d13mr21133077qvs.150.1579021061827; Tue, 14 Jan 2020 08:57:41 -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 j1sm6868284qkl.86.2020.01.14.08.57.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Jan 2020 08:57:41 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1irPVc-0003VV-RT; Tue, 14 Jan 2020 12:57:40 -0400 Date: Tue, 14 Jan 2020 12:57:40 -0400 From: Jason Gunthorpe To: madhuparnabhowmik04@gmail.com Cc: mike.marciniszyn@intel.com, dennis.dalessandro@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 Subject: Re: [PATCH 1/3] infiniband: hw: hfi1: verbs.c: Use built-in RCU list checking Message-ID: <20200114165740.GB22037@ziepe.ca> References: <20200114162345.19995-1-madhuparnabhowmik04@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200114162345.19995-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 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? Jason