Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2154526ybv; Fri, 21 Feb 2020 09:55:51 -0800 (PST) X-Google-Smtp-Source: APXvYqweYT/9qfczp0L3EFYJoiqFWM2+N3YgRWIwXyfm6CCpRZs08N59pBYsvJ/6ccLZ2ZkAxKUP X-Received: by 2002:a05:6808:312:: with SMTP id i18mr3100756oie.44.1582307751789; Fri, 21 Feb 2020 09:55:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582307751; cv=none; d=google.com; s=arc-20160816; b=s/OfqKwSpE79Up+oxG/qKA5pgfAfOLB/mtuP9EwpteXbBK1oNPApqw/xLbAoeITd3z dpHCm5A3YPvbcJq9aJGlByXtQOWSBZ0CZSvaZhTZcR+kH3jW6qEKx7xmEsK4tpcbzwh/ yAC8dLrVRwfvjSwrb9TXBqdC7WZ3mpzHC5GZ0FvL2JErAr9jlZqeaSUmBbKs6+wjZdaC 6P/Ir5dZ7v+PYQ8C4JZBQWWPsnH8k7G15ehv8atQnvX1YBTPjTwFRRjXjvWTxjPBj4UV 0lVs9G/vnDSzpSB2Z2c1YI6qKq17EA51h+5jezr3puVldC7dRayN0k3fa/PcP8DBVB0g WToA== 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=xIoPJC89gVWFrNtFw0AHmOeVBRfBncDtaR7CYLx5/Dg=; b=O3l/CFrPMsB6W5T2PEheM1frIzU6JPZ9vqbGnUICnL4PNZcAGC49V7y7HrVcLJkG24 jVmpBE84jm1NhmJohxLih/iVx+ZP8N1r5tpQvvKW84V8HHjnniUp4YuhSK/WCnM7Un8+ 8+SlSNRH5A5dGOL8IedJPnpfJBkoD34AenuTuxF+ITBNe4kwx6BFWwnzbzxg5tO+8p2Z 2Fc5nxVJywNfmQi2wDrkgGvJ7cuBKdjdjmT2AdRObbfa52HPqlOGfg24Y22IK6K/Dax6 wLI1jWKOA8cCAaBwpKdWHnfuCZUEjAjs9V7+bZBRG/AsiIsXt8yyRIuVWmeiTIwTWUTW 9tqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=HMPZ83NG; 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 g26si1807567otn.180.2020.02.21.09.55.39; Fri, 21 Feb 2020 09:55:51 -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=HMPZ83NG; 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 S1727699AbgBURyj (ORCPT + 99 others); Fri, 21 Feb 2020 12:54:39 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55695 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbgBURyj (ORCPT ); Fri, 21 Feb 2020 12:54:39 -0500 Received: by mail-wm1-f65.google.com with SMTP id q9so2656498wmj.5 for ; Fri, 21 Feb 2020 09:54:38 -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=xIoPJC89gVWFrNtFw0AHmOeVBRfBncDtaR7CYLx5/Dg=; b=HMPZ83NG9rwiQMFLrYVIV0XarG2yWBarAaYn0Or5vkNGo0gR6DPadrWYKJedIyWa/F VDgnkJ6P4JpsRgH8kGhl+10HQHX6TSvl9GyowzdP8yYq70W6phN5Cb63/hOdgQbcu6Tx YkdLfWx0HxrDj7fkgtG0WSO1onF1bWSHeJ8XdRiJqqE+rm1yLbOB6tSj6slBfjHUJA81 ner9fe3wnAZCTC0/zTIXmNjLemvcjc0X77JXFfVN7cVJTwWQRgTCKw03OS58T4dQocCW OeqSWb+7aDsP0Bs+Azg4p85XZFNxPPM2WOX1NIg1ifNOQJRCrbbB/KUDp5Vkv4iw39hB wIsQ== 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=xIoPJC89gVWFrNtFw0AHmOeVBRfBncDtaR7CYLx5/Dg=; b=q0+erXVVwziiVaQp5EUkBxKICTyp81DYMEUppRcgy2Nai6dpdfMqkN4GgbD7xiYmcK dsQF6r07bSd/Z6PAI/p8KTWfGKj+6YTfQ+DNDR9V6C/oH3hQUs6YGDvoQRwOnK0y1qXZ 0w++AA6W1zQGrUw0JrwM2t+otcHNgiUznS2mDID4XdfjRRXr415kTYNYOHo9EPnOWm5A 4M00jV+FGhgvERYJnHnQdO7Vf7e4TKwjw8YxqFgNKDPiKMxEQ1UPnN7WMejHrGgQ005w qhh/wsNKKJcRPzQtjdBIKMWF/BaEtHju+VlZZ2PjcItW8Ld9nl1bZtuKDT1V+OwH+hZ7 UgpA== X-Gm-Message-State: APjAAAU4DU2n1zMsQdsqkP6DsgwRJo8bEWqmTLF8oH5KVCMR+sNbKRqh GlsOjwxh1QsmRZ4BKSwU/dtMlA== X-Received: by 2002:a05:600c:21c4:: with SMTP id x4mr5079128wmj.147.1582307677644; Fri, 21 Feb 2020 09:54:37 -0800 (PST) Received: from localhost (ip-89-177-130-96.net.upcbroadband.cz. [89.177.130.96]) by smtp.gmail.com with ESMTPSA id j5sm4914621wrw.24.2020.02.21.09.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 09:54:37 -0800 (PST) Date: Fri, 21 Feb 2020 18:54:36 +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: <20200221175436.GB2181@nanopsycho> References: <20200221165141.24630-1-madhuparnabhowmik10@gmail.com> <20200221172008.GA2181@nanopsycho> <20200221173533.GA13198@madhuparna-HP-Notebook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200221173533.GA13198@madhuparna-HP-Notebook> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fri, Feb 21, 2020 at 06:35:34PM 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() >> >Hi, > >Yes I had noticed this, but I was not sure if there is some other lock >which is being used. > >If yes, then can you please tell me which lock is held in this case, >and I can add that condition as well to list_for_each_entry_rcu() usage. > >And if no lock or rcu_read_lock is held then may be we should >use rcu_read_lock/unlock here. > >Let me know what you think about this. devlink->lock should be held since the beginning of devlink_dpipe_table_register()