From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55564C742C7 for ; Fri, 12 Jul 2019 14:49:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E97A2080A for ; Fri, 12 Jul 2019 14:49:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="KOp/FTLl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbfGLOt1 (ORCPT ); Fri, 12 Jul 2019 10:49:27 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38230 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbfGLOt1 (ORCPT ); Fri, 12 Jul 2019 10:49:27 -0400 Received: by mail-pf1-f193.google.com with SMTP id y15so4418573pfn.5 for ; Fri, 12 Jul 2019 07:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jBnw+bj5T3Oj46YKg63m75/M9E4pXCF4gtk0jQxRSXU=; b=KOp/FTLlbPVrmtrESx26ciK+CMNvbkeSL4QP0Lj6JLKzSMGH7LcPtUDIBGFMz4xNBR HjyGCYh4oX95P+F+GW4vHbwJmHhtIANe/76JHUmqTCLEJnEQqDVcsDR2QKmjjip7dp/y Fs5wmHPUnwEv4E5Xcjpll4PYPsaq5Jw19jQ5s= 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=jBnw+bj5T3Oj46YKg63m75/M9E4pXCF4gtk0jQxRSXU=; b=i0Fu1MeRDJJ8ewGyLFX66tBjhpq0ZPr6g2YceRWGR66GNEJS5ZE9z/dgy2DPIFyS5W UFxAukSvggf4iXX4wyLVmg6nfiRr0Eg5Sx4r7my1DIdDDXu7b4R47ItzwCUuVeNTD1vh 2dvbpFbckVtSWFQnNEHaf3jDwHkyGJEBHU81h56GuCf0zZZ32/Y7YS2s3LrlG/sHTINS x4o1nHPpAYdRCJiaS5JSAZ3r6JAugIbIHCTl1Zto9xd/lza7WHUyAoRftBX6boL9lrHf CoM2AUhVOwtnMDUVpC71O4Bg5OvHubjUGae69vojvaraecNLdRVUGB34fVj7gFPZU/LC pg5w== X-Gm-Message-State: APjAAAW0yIE6fQvNHqi3n5tUzXzRwz7jELlhkI5ZHLWVfyUBTjJTsCg1 5KtdansoNqHKNGn67o+KQ1w= X-Google-Smtp-Source: APXvYqy6jBLSnDZta2GtS/zN+m3PUtaVacX1IRd1BaAhWjyV06geRNBslZ66J2GoeWCO1s2L6yvsyA== X-Received: by 2002:a17:90a:1904:: with SMTP id 4mr12585583pjg.116.1562942966736; Fri, 12 Jul 2019 07:49:26 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id r1sm7928157pgv.70.2019.07.12.07.49.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 07:49:25 -0700 (PDT) Date: Fri, 12 Jul 2019 10:49:24 -0400 From: Joel Fernandes To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Alexey Kuznetsov , Bjorn Helgaas , Borislav Petkov , c0d1n61at3@gmail.com, "David S. Miller" , edumazet@google.com, Greg Kroah-Hartman , Hideaki YOSHIFUJI , "H. Peter Anvin" , Ingo Molnar , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, Lai Jiangshan , Len Brown , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Mathieu Desnoyers , neilb@suse.com, netdev@vger.kernel.org, oleg@redhat.com, "Paul E. McKenney" , Pavel Machek , "Rafael J. Wysocki" , Rasmus Villemoes , rcu@vger.kernel.org, Steven Rostedt , Tejun Heo , Thomas Gleixner , will@kernel.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking Message-ID: <20190712144924.GA235410@google.com> References: <20190711234401.220336-1-joel@joelfernandes.org> <20190711234401.220336-2-joel@joelfernandes.org> <20190712110142.GS3402@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190712110142.GS3402@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Fri, Jul 12, 2019 at 01:01:42PM +0200, Peter Zijlstra wrote: > On Thu, Jul 11, 2019 at 07:43:56PM -0400, Joel Fernandes (Google) wrote: > > This patch adds support for checking RCU reader sections in list > > traversal macros. Optionally, if the list macro is called under SRCU or > > other lock/mutex protection, then appropriate lockdep expressions can be > > passed to make the checks pass. > > > > Existing list_for_each_entry_rcu() invocations don't need to pass the > > optional fourth argument (cond) unless they are under some non-RCU > > protection and needs to make lockdep check pass. > > > > Signed-off-by: Joel Fernandes (Google) > > --- > > include/linux/rculist.h | 29 ++++++++++++++++++++++++----- > > include/linux/rcupdate.h | 7 +++++++ > > kernel/rcu/Kconfig.debug | 11 +++++++++++ > > kernel/rcu/update.c | 26 ++++++++++++++++++++++++++ > > 4 files changed, 68 insertions(+), 5 deletions(-) > > > > diff --git a/include/linux/rculist.h b/include/linux/rculist.h > > index e91ec9ddcd30..78c15ec6b2c9 100644 > > --- a/include/linux/rculist.h > > +++ b/include/linux/rculist.h > > @@ -40,6 +40,23 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list) > > */ > > #define list_next_rcu(list) (*((struct list_head __rcu **)(&(list)->next))) > > > > +/* > > + * Check during list traversal that we are within an RCU reader > > + */ > > + > > +#define SIXTH_ARG(a1, a2, a3, a4, a5, a6, ...) a6 > > +#define COUNT_VARGS(...) SIXTH_ARG(dummy, ## __VA_ARGS__, 4, 3, 2, 1, 0) > > You don't seem to actually use it in this patch; also linux/kernel.h has > COUNT_ARGS(). Yes, I replied after sending patches that I fixed this. I will remove them. thanks, - Joel