Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp410215ybi; Thu, 11 Jul 2019 21:56:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkzS45caAIVIC1cEZ5i+FE53yYdZHrYXsu9twzFMNleg35ZgNRZNS16M9iM/dqD/JXkKGK X-Received: by 2002:a63:e948:: with SMTP id q8mr8227195pgj.93.1562907394823; Thu, 11 Jul 2019 21:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562907394; cv=none; d=google.com; s=arc-20160816; b=XmRHrERQ4kRcEaaTBuHHWcLIivV8pm475MmUGv+KbcwzWkI72IcWNFovf/qEjbj9ia WByb8cOuKgpy5uLvcqavB8yRkYWZQQAzZrDubBHKtbUIsxZlJ8qNSbzZsf+SmGxltjuz 2ydjRjL8DQnQnBf9+/x4srhDJ4DjsCTeNzwz8cdPOUCls64pI3uMryvwbOtlgUu+j93L KQ7tMBNeXJaCP+sWMAU7hrsjbjVh53XCMLMOjraPoVvvM2PpFjfXVxYe6ZSIXbpxAwPK 93pd94rynA0l74RfqygCHuK1gWotQhcOd6jy84xpVZqlQQ6/lBkJrwZmb1SCGoQQf1bw vb/w== 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=sZaWxx8XHNIJMce0La5YzhGUKfsnDTNKcipBsPeCHZ0=; b=Ip/fnHJCbfWT0RSZcrC1966njxPOFDae2/XGdxiIt0AVxRJuvtYKthbk/Z8vAnsBTx fN7zXcuUK9a8aRbcJgdAaILaPgUOwGgowEO5IuSXbWTR9xPkVHPdv3t+A8vDWJMq0/3n t8f+g+qqshi0I5COUw6Q7kOjdehji5Iwki2H2ijB92o2xJEx6hcVLOTEItBiEu+6Ns2O qdMJqbzh4I0DjJcWZVP0B2UQRgSp4jphddWWYrzzQMceu9e/AfbFFPTOMMV3Sdnsi5b5 1W22GdYHWcvmUa+M0uR3iW+09a+gczCOQOrY6VKida+5iMCXwtkxAH1OjupQLst95bYn 4xbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="yOt7w/De"; 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 j62si7337744pgd.170.2019.07.11.21.56.19; Thu, 11 Jul 2019 21:56:34 -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="yOt7w/De"; 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 S1729652AbfGLEtz (ORCPT + 99 others); Fri, 12 Jul 2019 00:49:55 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38149 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbfGLEty (ORCPT ); Fri, 12 Jul 2019 00:49:54 -0400 Received: by mail-pg1-f193.google.com with SMTP id z75so3958611pgz.5 for ; Thu, 11 Jul 2019 21:49:54 -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=sZaWxx8XHNIJMce0La5YzhGUKfsnDTNKcipBsPeCHZ0=; b=yOt7w/DexKthec8S9bla5Nx+r59GqFfAOL7iCfVyMvvo12JVGSvX3T81WoloMImi33 kqYLvYFnbIzGBh0eyfsd9A0LnYst3mMT6/NJY4r3NhPNnt7TTUTpl2mOkUwjTOfy2DNL VOBKxv4cXPqq2gZ1bBRS4yYBmuTei0KY5yRss= 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=sZaWxx8XHNIJMce0La5YzhGUKfsnDTNKcipBsPeCHZ0=; b=qhl1JkZcJLWRW0vfCFCyDtmsEmCEBSQADQNrqB3QsUaoSCrbJiD08UniU5Bp9h7fvq Wz1IlFPQlXxRO5GmHYIeCfCegYlY5Dwg0Jm7tPMAc17BhWip4VxSV/OhbvxCT9v0Ac02 wXEjmGN/lzbfNbPgzMDTBdN0cb0zSK6xWuDv41iKE5hUVTHD3CCPNR+KWNfVYIHjbl7s jR8kvL6dD+fk1Z1rwjizs/gZxyj4rtO/la3AHhHw7AhwoX1NanR4/h+cmWutcWiyS1hE z99CZ6qE6oXnPbmc5E7ytwE5+gOteh0j11rpeP9e20+XN7l0/ksDPen5qFW6+g0QXAfL 547Q== X-Gm-Message-State: APjAAAW0kpIsjmlS9Md/hhEuZRb7G0KZZ/5IoXNFIsv3kYTQ6TK5IpW2 bjKT4QqHOPtXg3hZD6H1AOFLtEWQ X-Received: by 2002:a63:c008:: with SMTP id h8mr4417616pgg.427.1562906993264; Thu, 11 Jul 2019 21:49:53 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id d14sm9667480pfo.154.2019.07.11.21.49.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 11 Jul 2019 21:49:52 -0700 (PDT) Date: Fri, 12 Jul 2019 00:49:51 -0400 From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: 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 , peterz@infradead.org, "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: <20190712044951.GA92297@google.com> References: <20190711234401.220336-1-joel@joelfernandes.org> <20190711234401.220336-2-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190711234401.220336-2-joel@joelfernandes.org> 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 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) Fyi, I made a cosmetic change by deleting the above 2 unused macros. - Joel