Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2457966ybf; Mon, 2 Mar 2020 09:03:04 -0800 (PST) X-Google-Smtp-Source: ADFU+vvl9kq11s8QnBryd/y7jjHIRJvG2sdDXizJPSajkLUX/LwX8NyAoj6kE0AZTOK/bjaVUGpb X-Received: by 2002:a05:6830:1f03:: with SMTP id u3mr139572otg.152.1583168583957; Mon, 02 Mar 2020 09:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583168583; cv=none; d=google.com; s=arc-20160816; b=Y/yyL7hiUjXpkX+18/Bt28kiXxwd4dd2fFSmkZiR1dax5Gnr6sM+3soUDPSPFnLvfb VRmB463rm4uWWaaeCK8Uhs08kj4hoIYwnspSiB/bHNn1dZEkFl3fI/uFKwX4rhRyosXb u+nW2XHO12+VC7C5rFqB0JayS1MqHI63VhyrwObPBnAIRdvY4Cls8Hv7LhTyyoejILG0 l92xnNEIKY1iah5PF5jVehlhKQCo6HpZc8HovWj0q4ZxuIMoLvWrANQsCxWzYMARyQ3s V8uekAy62oZBUrF+LpVDA1HoH3IXBQ1/ziFuLmuCzI6Q7nI06vhUJ/u1NnFOy7IO6u2g OEBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=3E3fWxDEv9ZHfmOkcec5gIIJeOvKCzK/ypdiNkYfC8Q=; b=SSkoWZG4nAj9bMKhbW7gqFJAAnxsYbxkYyBoEtXAvM2U33LhifVkEX3G6xeQ0IXRfY NF6t5RbqvcOS9o0a7qdGyrvL76SuBTbbfNK6LEq/grQoA6Kz5TPm9cEq2qIcNkB9QOGb CDLAhnrrREDFY7yi78INwYO9iPoUl1DLZjM0pioyRSgb4v+w8EvlxgjeOeNhFff9xJks sTMAO/ace9Z4/epjLUbXOotljuqNjig3TUbbmXIL6kMCsarn79bxURS8ACLR4NE4Yu58 GqImgWlt2d5izwXi8x1GnznD3opt6opnBXJEAPPHhv2i8ncLx68xRVzwb8UB3qyjmWju knTQ== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si6591030otr.320.2020.03.02.09.02.48; Mon, 02 Mar 2020 09:03:03 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727450AbgCBRCd (ORCPT + 99 others); Mon, 2 Mar 2020 12:02:33 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:35185 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbgCBRCd (ORCPT ); Mon, 2 Mar 2020 12:02:33 -0500 Received: by mail-ot1-f67.google.com with SMTP id v10so3157624otp.2; Mon, 02 Mar 2020 09:02:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3E3fWxDEv9ZHfmOkcec5gIIJeOvKCzK/ypdiNkYfC8Q=; b=PU5YSgJM0v8gIGcwJCuVXvlgu5Cm9dRRs4HeH+ZE1UYmKTrqSHRrSeIklZmnd41AF8 TiM+ovRk8Esx/fBCyLAR6jMKwit0RuIXMzXXNfNE+ZF5RmWwxHLLH1bor53s4fn+IMbF 9B/CfH1QAeIEhW+oAg96abRDPoiPlPYVXSt0COj3g2zrWOdlY9pBYbW+lLHl/yti71h5 Vpjr4HD9YzUGHZUwvoSUeTjk51WC4jHfpWa3LQ51Ypr7JvmrDtSDYYVTiTZuNcp2qdwz FIRA6C4Uvesg70p2NBCTIZCLujXKyaclBHDL9CFoyOwKJzMTq1NAk5QHWi+Tdc6NInl5 MPtA== X-Gm-Message-State: ANhLgQ2AagbWnLnObH29eBzcxI/w2JG5nx/sU13i0gXrTcNmcR2HJFkA Ee/ALzUBKxbKduUDYlRaQAeFis6BDAb/c3woLS0= X-Received: by 2002:a9d:67d7:: with SMTP id c23mr125593otn.262.1583168552404; Mon, 02 Mar 2020 09:02:32 -0800 (PST) MIME-Version: 1.0 References: <20200228174630.8989-1-madhuparnabhowmik10@gmail.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 2 Mar 2020 18:02:21 +0100 Message-ID: Subject: Re: [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking To: Madhuparna Bhowmik Cc: Joel Fernandes , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , Linux PM , Linux Kernel Mailing List , Amol Grover , linux-kernel-mentees@lists.linuxfoundation.org, "Paul E. McKenney" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 2, 2020 at 1:34 PM Madhuparna Bhowmik wrote: > > > > On Mon, 2 Mar, 2020, 3:48 AM Joel Fernandes, wrote: >> >> On Sun, Mar 1, 2020 at 4:23 PM Rafael J. Wysocki wrote: >> > >> > On Sun, Mar 1, 2020 at 9:53 PM wrote: >> > > >> > > >> > > >> > > On March 1, 2020 3:12:53 PM EST, "Rafael J. Wysocki" wrote: >> > > >On Fri, Feb 28, 2020 at 6:47 PM wrote: >> > > >> >> > > >> From: Madhuparna Bhowmik >> > > >> >> > > >> This patch passes the cond argument to list_for_each_entry_rcu() >> > > >> to fix the following false-positive lockdep warnings: >> > > >> >> > > >> [ 330.302784] ============================= >> > > >> [ 330.302789] WARNING: suspicious RCU usage >> > > >> [ 330.302796] 5.6.0-rc1+ #5 Not tainted >> > > >> [ 330.302801] ----------------------------- >> > > >> [ 330.302808] drivers/base/power/main.c:326 RCU-list traversed in >> > > >non-reader section!! >> > > >> >> > > >> [ 330.303303] ============================= >> > > >> [ 330.303307] WARNING: suspicious RCU usage >> > > >> [ 330.303311] 5.6.0-rc1+ #5 Not tainted >> > > >> [ 330.303315] ----------------------------- >> > > >> [ 330.303319] drivers/base/power/main.c:1698 RCU-list traversed in >> > > >non-reader section!! >> > > >> >> > > >> [ 331.934969] ============================= >> > > >> [ 331.934971] WARNING: suspicious RCU usage >> > > >> [ 331.934973] 5.6.0-rc1+ #5 Not tainted >> > > >> [ 331.934975] ----------------------------- >> > > >> [ 331.934977] drivers/base/power/main.c:1238 RCU-list traversed in >> > > >non-reader section!! >> > > >> >> > > >> [ 332.467772] WARNING: suspicious RCU usage >> > > >> [ 332.467775] 5.6.0-rc1+ #5 Not tainted >> > > >> [ 332.467775] ----------------------------- >> > > >> [ 332.467778] drivers/base/power/main.c:269 RCU-list traversed in >> > > >non-reader section!! >> > > > >> > > >I don't see these warnings in the kernels run locally here. >> > > > >> > > >What do you do to get them? >> > > > >> > > >Joel, any comments here? >> > > >> > > You have to enable lockdep in your config. Does your setup have that? >> > >> > CONFIG_LOCK_DEBUGGING_SUPPORT=y >> > CONFIG_PROVE_LOCKING=y >> > CONFIG_DEBUG_SPINLOCK=y >> > CONFIG_DEBUG_LOCK_ALLOC=y >> > CONFIG_LOCKDEP=y >> >> > I had CONFIG_PROVE_RCU_LIST = y and I think these warnings were triggered when I had closed my laptop (like just close without shutting down). OK, so let's define a macro for that in this file to avoid code duplication. And analogously in the second patch. Thanks!