Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3863191ybv; Sun, 16 Feb 2020 07:34:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzJCIY/dsUfr1J1rKzGlRdcMY2MSgwK2yofcyhtqgM5FOWk4iWfbzJgNwjLwPuLtrCO/QaB X-Received: by 2002:a9d:7696:: with SMTP id j22mr9785313otl.188.1581867261216; Sun, 16 Feb 2020 07:34:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581867261; cv=none; d=google.com; s=arc-20160816; b=sD1CDOz+I6aLSG+WlGtBoBr15O6h5b5lz8lZE1X4Wniz6Q7kyti3to5zZWsYZM1NYS SJLtrwY6h2H1Db6br8qyhmqTkOasjbSg7kvN1RvFbU5a4PsmUiWEVVTJUf+D1OVtoKIZ TVbuQ67qfz2ua3CvqRKN6W3L9yeyx5pzKGD64/z/LCOxmEkvAQjIfkS2UXTLNZHULP1+ HpxVvR6BRlD45J7ERG7rCmqzkP6dll7wSrTEpJlPva+VdK8VMOnxHzd+T/RQHTMHuOTV B1MasB3fpg0oDrHtvoPBLERNUmAuF5D+9xXK9R1wMqnObkSIOPSxdTCn42ZW938vDpZq nMig== 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:date:from:dkim-signature; bh=XIEPrOUEc1xxULTMEXHUWg4Qjw7jq42rfdXNd7KhPm0=; b=v1Z2SOiPdD8fSYiLzNIXY51DtToY9lgBlT3jsEa8Z+eBvhV1nQ2xwBM0wiQyWTBZqY fi8C7FND0ErDrw0XcFgYtm0CNBKEpWgIYjgYTC6OFqXeNp8NMBJPdJG4vh1VDKnBYaoi 7985tDmHOnHXBhfBfGb3yOp9VJZp9Hkt7bXO8z+Lo+mBnGu01JgXo9+KXWjLHIS21nbS ixigDRV737B1Kjgt2ODN+EP4Z+np1p1DH5QhmhTulzuRHiedkQqGLzDYbQ7Mnyr93Mcp DZ3owvZ4fHMlTQUv2hjAb/lAOpH8Aqf4A2bhIHQ6kKHOmavClQp/eOYkh1XUViNsPQYy 2+Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BHr0jtmd; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z26si5334670oid.247.2020.02.16.07.34.09; Sun, 16 Feb 2020 07:34:21 -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=@gmail.com header.s=20161025 header.b=BHr0jtmd; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728361AbgBPPdd (ORCPT + 99 others); Sun, 16 Feb 2020 10:33:33 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43415 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbgBPPdd (ORCPT ); Sun, 16 Feb 2020 10:33:33 -0500 Received: by mail-pg1-f193.google.com with SMTP id u12so7347698pgb.10; Sun, 16 Feb 2020 07:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XIEPrOUEc1xxULTMEXHUWg4Qjw7jq42rfdXNd7KhPm0=; b=BHr0jtmdSFo5SLeKbPpnFJoeBLATA6KiCLy+hyrRGKN8KbNvjxZ/J43HsJYCVHOzMd Q6OAkwpSXJZFKMuHKPtxMF1X2hmBPsxRa8lhrm0kiUwG00ub0kvx6+9wE8oUBEec2njr EPuMwg4LhYMpTptmi8w7XmTHRl4SDsa/QVMzN/543SyYgSHGN7FhJOve5/uD9Fsc3fXP leQOPbLTa10oqBFxnrYs1Ynxc59xc7a/nJ7EDhydBtaGVk/kJSgPZ7ZGp8IrUnZO1TN9 pb8jXvat/htlqWdzY4I6MZdXNjjKe5a8HL6txN9iArq59JtTbjOkiFoUcuYVTNC0PH85 t04w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XIEPrOUEc1xxULTMEXHUWg4Qjw7jq42rfdXNd7KhPm0=; b=S51dXmlfA/vnKDxV6Y0xNnnFq2FQw1OP5rvU7w4IUAqYUCjbzxk4BVlxApTgUpnV85 YrSPpg961km6phY1OmyvSMCRApUswhDuGZBqJxz+cIpFOZejVvvB0iUDq9zqJSYL/JPp bnGRDun8kPLAKKrL1XWhltvg6RAXHwlo73dqmszgc0ubHmTyRfukg7c1WNjrTFcZI0i7 WECR6McEN9/SF/5a5fTvRPWMWdI0aeAxq4+Kyb4ztrpK86Pqn5bLZShGUOWsC/WDf4xy tGRMn8DfQElVW85GqwFebZUtHX6IX0Nq4Nma4tClpca+UDku5KyYxOJiEp0yJmNi+Lej eXzw== X-Gm-Message-State: APjAAAV1mfYp8SWObD5pqwVKafSMqgbpDrkilJ+xMwJvrHgdQkm9Rmez fg0FjVa04+n6dtBljodsDQ== X-Received: by 2002:a65:6147:: with SMTP id o7mr14233461pgv.442.1581867211415; Sun, 16 Feb 2020 07:33:31 -0800 (PST) Received: from madhuparna-HP-Notebook ([2402:3a80:d03:50cf:14b2:4950:fe83:57e]) by smtp.gmail.com with ESMTPSA id m15sm14347484pgn.40.2020.02.16.07.33.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Feb 2020 07:33:30 -0800 (PST) From: Madhuparna Bhowmik X-Google-Original-From: Madhuparna Bhowmik Date: Sun, 16 Feb 2020 21:03:24 +0530 To: Sven Eckelmann Cc: madhuparnabhowmik10@gmail.com, mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc, davem@davemloft.net, b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, joel@joelfernandes.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH] net: batman-adv: Use built-in RCU list checking Message-ID: <20200216153324.GA4542@madhuparna-HP-Notebook> References: <20200216144718.2841-1-madhuparnabhowmik10@gmail.com> <3655191.udZcvKk8tv@sven-edge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3655191.udZcvKk8tv@sven-edge> 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 Sun, Feb 16, 2020 at 04:22:51PM +0100, Sven Eckelmann wrote: > On Sunday, 16 February 2020 15:47:18 CET madhuparnabhowmik10@gmail.com wrote: > > From: Madhuparna Bhowmik > > > > hlist_for_each_entry_rcu() has built-in RCU and lock checking. > > > > Pass cond argument to hlist_for_each_entry_rcu() to silence > > false lockdep warnings when CONFIG_PROVE_RCU_LIST is enabled > > by default. > > > > Signed-off-by: Madhuparna Bhowmik > > --- > > net/batman-adv/translation-table.c | 12 ++++++++---- > > 1 file changed, 8 insertions(+), 4 deletions(-) > > Added with alignment and line length codingstyle fixes [1]. > > Can you tell us how you've identified these four hlist_for_each_entry_rcu? > Hi Sven, Thank you for the fixes. The other hlist_for_each_entry_rcu() are used under the protection of rcu_read_lock(). We only need to pass the cond when hlist_for_each_entry_rcu() is used under a different lock (not under rcu_red_lock()) because according to the current scheme a lockdep splat is generated when hlist_for_each_entry_rcu() is used outside of rcu_read_lock() or the lockdep condition (the cond argument) evaluates to false. So, we need to pass this cond when it is used under the protection of spinlock or mutex etc. and not required if rcu_read_lock() is used. Thank you, Madhuparna > Thanks, > Sven > > [1] https://git.open-mesh.org/linux-merge.git/commit/967709ec53a07d1bccbc3716f7e979d3103bd7c5