Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp987476ybi; Fri, 12 Jul 2019 07:51:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJSGNqk+ln+3k78nbx/z4y7QefFPBw8wZg57HQkHnmqCHyTU+iboiFaBXQQzSZtjc9zQR5 X-Received: by 2002:a17:902:467:: with SMTP id 94mr11826405ple.131.1562943082531; Fri, 12 Jul 2019 07:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562943082; cv=none; d=google.com; s=arc-20160816; b=Xoltc75A0MeIzBosMddS26avJDwXMkBS4VCIavQZkdXI0kcGGQt7kSt1j4plYsWceT vZbdRm21RoSIiQsGxmzQtAa9pOKCuzye2ui7CRxToW+AV0P88t/NiIc3SVNEYrMh9Gy8 1eDtfk5gzDWDHG5Pai9i2X2MlL6eWq5kMbI9DFU+tGFOuwpe1EaRxt7loZEIFH8tIjX6 yl+HgwNEkZHQ7+AwBqbV9FbW3mZlxTxnfDonU493c7IYUBRVgEZuzcZEY7him4eCq+MD ReiPoC99eqMhcxOFLkouMvvSto8iIIAqk9ULF6IsUfSwwp8kpWilvb4OqtL47M3TbwyU FdlQ== 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:from:date:dkim-signature; bh=jBnw+bj5T3Oj46YKg63m75/M9E4pXCF4gtk0jQxRSXU=; b=SoJc3FTLP//D6t9ilUdXdoMiGsJ0E9LxV0eruTStM5YieMroZy5PyZ+6NOkaJMAaXo blkji0QXEEMESdw/45HTA5i9KLVvZj63sKlP2L37g6/CnDI4P6ubVGw80zLuSf3VMFNJ ubXBc6bYwSWPTprzuI3FQU6JRlP7ktxf6/hYYC9owrmCJy8h71jRFFOw/GLnkTCzG7Jr LEfpaNt7NnQ0E2pFlF0IUNrdUSxL28uhmP8hpeZUZY2xvUbvjsYH0tvP8tnsCDB+Ki2W aerFE1C58nkk6PClpF+MIh1EzzpusCNDiuz//mBTmUfoSUmuvN7gsHO36wCoueEw6LsZ eSUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="KOp/FTLl"; 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 z26si8771833pfj.247.2019.07.12.07.51.04; Fri, 12 Jul 2019 07:51:22 -0700 (PDT) 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=@joelfernandes.org header.s=google header.b="KOp/FTLl"; 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 S1727114AbfGLOt2 (ORCPT + 99 others); Fri, 12 Jul 2019 10:49:28 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46752 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726982AbfGLOt1 (ORCPT ); Fri, 12 Jul 2019 10:49:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id i8so4627638pgm.13 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=IJLKfBRtXDBMJLJo76yUryZPNNyxaAiWjt8iZzwluYS0Q2beVeklMJxfjA9408erTY 3LJy2RfefscxCDxEATSrTwYJNeT/OzMm17c3up68XXY+9udGNeYq2obCuixbthZRV3Wr ghZLabBq3IXRgyyS72YpdJI3wJjZa5qHTze/uTOtmoRfxCyWgveiwbKPnkDJnSMVCFAW yL7SzQojHQu/otclA+efvCn3fSCsGNJK3uaYiRj7UvxhoR/fMzsd6CEJRnYZSdsF9LYz c2wwYO0JaQFoXxNLEpzPEYcM1a4vnJ5l9Cmw6iZKVqs822DqbpSvk3hfIezitW4oGbsB l/+Q== X-Gm-Message-State: APjAAAWeibrjp8EuHarcba3tmYKNV5vnVR4/i94GDcDH3k7RZwZ0pwLp z7LwLy4kKMT8hh5TrVegM95cfylA 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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