[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190712044951.GA92297@google.com>
Date: Fri, 12 Jul 2019 00:49:51 -0400
From: Joel Fernandes <joel@...lfernandes.org>
To: linux-kernel@...r.kernel.org
Cc: Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Borislav Petkov <bp@...en8.de>, c0d1n61at3@...il.com,
"David S. Miller" <davem@...emloft.net>, edumazet@...gle.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
Josh Triplett <josh@...htriplett.org>, keescook@...omium.org,
kernel-hardening@...ts.openwall.com,
Lai Jiangshan <jiangshanlai@...il.com>,
Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
linux-pci@...r.kernel.org, linux-pm@...r.kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
neilb@...e.com, netdev@...r.kernel.org, oleg@...hat.com,
"Paul E. McKenney" <paulmck@...ux.ibm.com>,
Pavel Machek <pavel@....cz>, peterz@...radead.org,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Rasmus Villemoes <rasmus.villemoes@...vas.dk>,
rcu@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
Tejun Heo <tj@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, will@...nel.org,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>
Subject: Re: [PATCH v1 1/6] rcu: Add support for consolidated-RCU reader
checking
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) <joel@...lfernandes.org>
> ---
> 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
Powered by blists - more mailing lists