Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1595525ybv; Sun, 23 Feb 2020 10:20:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwEBA/XmO3i6vM5RcRv9/Kwli9dazaKw7OYpTJ9bL17I++vRmwVFabLXh97x0trSHmyWDPF X-Received: by 2002:a9d:23b6:: with SMTP id t51mr15079532otb.15.1582482033317; Sun, 23 Feb 2020 10:20:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582482033; cv=none; d=google.com; s=arc-20160816; b=qUsEYihhqW3ibj+BUNILIr3/R1jdjeOpn8dhqlqsR1aEC5ghMRnB7TnJcCqLVazdZe 6AWnY4fi1bV9DoZBIN9m2SuBcC845SXxgiIBSdM7A/eNXo+T+Ui1wCGZuJckoNroucXl NF8eE2UCk9JVNzlONtHDh4KLlNOch2cg0QVLTD0F6XI909bzX+MuXy5DXOx1RbkzCIhm q1zV5O7LWu6e+hc/GO0E9w3wSeyiEkfeasIkjyLN2ZPZTlEY60NVcmxjUP9Fl/eSHYXA rlQdwphz8HkV4PaPzHcjZsjB9rSb9ZTjtok11NipmJAHGWf2DlYG6PIXtfdiyP75Ikbg WqdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=FqHsgNFlSSHhJTOWB1G7rDoiJVu5BMqVM2zZksRNNdQ=; b=DAvmgxzSjIlUHJZ1E556ufhlKO8wpGFI9VDB305gzeGlunjy0DsWMrh13qrU+rXNjL gs8Cs1ZB7327HXFMXRtnJRcyP4wuVGzSfdqoHgam1OBN7v0FQ3FghjW79O+bXcDL4UcK OWSCSzhw8L5Z4w7BON5kD2XbK4cV9wZganh7FWyF5B1gbNH+W07aSHedS2/Pga/Bm9iF qpXhargpJSdRw+MF0vJj3xx55UsmT9tgFADOllPAWrq1ZKdRLdI5BUnHx1/5ilZHOVBF PRhFoEpNyW+B3USy9EcXr0+lptBPqMYQDVn9cIrWmUVsCO2hkJIyxJqIYGyfGQLGFLwS pD4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=jSbgn2w7; 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 d1si5298815oth.158.2020.02.23.10.20.21; Sun, 23 Feb 2020 10:20:33 -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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=jSbgn2w7; 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 S1727156AbgBWSTi (ORCPT + 99 others); Sun, 23 Feb 2020 13:19:38 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38963 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726302AbgBWSTi (ORCPT ); Sun, 23 Feb 2020 13:19:38 -0500 Received: by mail-wr1-f68.google.com with SMTP id y11so7732656wrt.6 for ; Sun, 23 Feb 2020 10:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FqHsgNFlSSHhJTOWB1G7rDoiJVu5BMqVM2zZksRNNdQ=; b=jSbgn2w7cVRMomeohFPnY+ivGDINUX5QQpgab5aHCquYazWZCfiXR6X9D2cF64pDA/ sTmoA5szkmDXbs8uW46tpiPZW0nMrgkRuh7XvGiYe27YXbA2S/cd1IlNu1oLEEHtvSvI ken/DNbscknXxXjOuDISRVxkEBlSIgxXpk01uscWMjrhMBIBUkqaIYvfhKvxiuqX1Qah 6UjW+Vxg2VOgoUFv/syjEBKKGHGH1CgS7hHlZbZedxfj54I8Z6zsYwGqQDNBwseOH5Vs /IfJGEd8T5PAMnFh/Hat/Z6ka8F/eLSGUW2MuGJC6ApE9oS8Jq4xtn1y+VIdsUW/6AnJ 7KTQ== 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; bh=FqHsgNFlSSHhJTOWB1G7rDoiJVu5BMqVM2zZksRNNdQ=; b=c0bLl71xTEmibZ+1gB9DhmDK+GNYRdvj6KyW0g7/bBqNsDacVE/e1gegbQWQL7yWza KwkH+rn8EV+3qNbpESeekCG7sSPPnFdvqBGN1enDw0gcboVVZ+6O51FVbWsdrl5kTxyp qcqhW88RgxjLSMrjpaPublEc4C/XGDF3ajkPWQrcqC2WNIeusBdIPo3u1qUM9Jr5B9Gu B99WxcmvhPt54bWiEsyIRd62y9WDOFFEgTThYNhoWgyx7jTnokLyVVWEe2coGzf3bvGy 2TNtrYXVmWw3WZVf/01COVPWRyc9bQE/zu/YIOkJFgNm5prwEuTgmtLtyc63FUgQsd07 dVNQ== X-Gm-Message-State: APjAAAU7eKV/HaWTkg1X4naLDS5aLQwvYz0x7CsLTrEIRH+u/EVRnfsn faC8bIw3G/4J5+MTxHXIvheZaA== X-Received: by 2002:adf:e3cd:: with SMTP id k13mr37100249wrm.302.1582481975798; Sun, 23 Feb 2020 10:19:35 -0800 (PST) Received: from localhost (ip-89-177-130-96.net.upcbroadband.cz. [89.177.130.96]) by smtp.gmail.com with ESMTPSA id b10sm11285443wmj.48.2020.02.23.10.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2020 10:19:35 -0800 (PST) Date: Sun, 23 Feb 2020 19:19:34 +0100 From: Jiri Pirko To: Madhuparna Bhowmik Cc: jiri@mellanox.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, joel@joelfernandes.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, paulmck@kernel.org Subject: Re: [PATCH] net: core: devlink.c: Use built-in RCU list checking Message-ID: <20200223181934.GG2228@nanopsycho> References: <20200221165141.24630-1-madhuparnabhowmik10@gmail.com> <20200221172008.GA2181@nanopsycho> <20200223110342.GB2400@madhuparna-HP-Notebook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200223110342.GB2400@madhuparna-HP-Notebook> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sun, Feb 23, 2020 at 12:03:42PM CET, madhuparnabhowmik10@gmail.com wrote: >On Fri, Feb 21, 2020 at 06:20:08PM +0100, Jiri Pirko wrote: >> Fri, Feb 21, 2020 at 05:51:41PM CET, madhuparnabhowmik10@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() to silence >> >false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled >> >by default. >> > >> >Signed-off-by: Madhuparna Bhowmik >> >> Reviewed-by: Jiri Pirko >> >> Thanks. >> >> However, there is a callpath where not devlink lock neither rcu read is >> taken: >> devlink_dpipe_table_register()->devlink_dpipe_table_find() >> I guess that was not the trace you were seeing, right? >> >> >> >--- >> > net/core/devlink.c | 3 ++- >> > 1 file changed, 2 insertions(+), 1 deletion(-) >> > >> >diff --git a/net/core/devlink.c b/net/core/devlink.c >> >index 4c63c9a4c09e..3e8c94155d93 100644 >> >--- a/net/core/devlink.c >> >+++ b/net/core/devlink.c >> >@@ -2107,7 +2107,8 @@ devlink_dpipe_table_find(struct list_head *dpipe_tables, >> > { >> > struct devlink_dpipe_table *table; >> > >> >- list_for_each_entry_rcu(table, dpipe_tables, list) { >> >+ list_for_each_entry_rcu(table, dpipe_tables, list, >> >+ lockdep_is_held(&devlink->lock)) { > >Hi Jiri, > >I just noticed that this patch does not compile because devlink is >not passed as an argument to devlink_dpipe_table_find() and it is not >even global. I am not sure why I didn't encounter this error before >sending the patch. Anyway, I am sorry about this. >But it seems to be the right lock that should be held and checked for >in devlink_dpipe_table_find(). >So will it be okay to pass devlink to devlink_dpipe_table_find()? Sure. >Anyway devlink_dpipe_table_find() is only called from functions >within devlink.c. > >Let me know what you think about this. >Thank you, >Madhuparna > > >> > if (!strcmp(table->name, table_name)) >> > return table; >> > } >> >-- >> >2.17.1 >> >