Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1033654ybi; Fri, 12 Jul 2019 08:35:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/AJxZGqHWQOTZHx+fxAwfCq+vHXdD2zEsCG7q8n6Fc/bxuGFRpOfjL1sCYzdoTdNcKn4g X-Received: by 2002:a63:c4:: with SMTP id 187mr11308094pga.272.1562945736950; Fri, 12 Jul 2019 08:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562945736; cv=none; d=google.com; s=arc-20160816; b=yWygzG4ahUI6jclwg7mslYWVWhK04tPhGm/r/MK83p/P43KFapDh+t9zLosA7atP2I SOmfgT24epyDXtqROla3CBWm+s4c/kGEzwZ4SH2HXyeSrxNXm/IquWOE864YGtj+FS90 2RO7D3HQVanqi13+MoeevfayVKRajn1qBEDiessgkGdDnR58/ayzvWh5XQJUoH3G5eHR wy+2UBcY0ni4WOa0bBB9hzWimfDG8SqzCgTRsK39Nuvk8rUNURZV3gUCV1TFsOtCrfjG QDSb2Ntlm5DxBLyd7+9dAum4ApJcTzIi0mo/41l4+rQ5Y/14U1hH2d4FIm4x96fgXn0j T6pA== 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=plTISl7XRgKbWO6zw1c5j3WZeogtjYrXm6i/h/jyEdM=; b=JcBot8BEDAQ7Q0j/29+VPrWRXh38OiFJ5+6gs9GmaJyrMjBrstOo091IHbGLBImZo8 rZxQHenPjgSdUSJs2lc5RboxlSjjVHueheGIuGdfv74dRmVRCB8PCMDhLAfGni2t+0Xs CZnnZlsPS6WkoBac1/COg/ER/3wE+Nram/cm95sDJ72ZvL96VORxpbPDXdc78uIeS3Cd Z/LQpbpYUvbaTQNtwv9V2uscT8tjIpepwkV7XutIZp4rbzDDhf/7cGCl90jhi6nCAQLA v8LFy1hMbmLPEQp68Ak9Vzj16oHYdROOWNawuByUP7il2+WtPm1G6W0jr8T3DJHx8hAD IgJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=d3vjeUDp; 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 f5si8222791pgq.137.2019.07.12.08.35.20; Fri, 12 Jul 2019 08:35:36 -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=d3vjeUDp; 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 S1727306AbfGLPeg (ORCPT + 99 others); Fri, 12 Jul 2019 11:34:36 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:37389 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727284AbfGLPef (ORCPT ); Fri, 12 Jul 2019 11:34:35 -0400 Received: by mail-pg1-f193.google.com with SMTP id g15so4704561pgi.4 for ; Fri, 12 Jul 2019 08:34:35 -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=plTISl7XRgKbWO6zw1c5j3WZeogtjYrXm6i/h/jyEdM=; b=d3vjeUDpa24Uc8U/u+S+d6BI2l6i7lglR9JIxg0XBVZioQ6X8zajrBKL90Iwon+bp0 Us06yFpgUdXGq/Y8vA3j3OHHbl3hebXZ3RDMsWe4b6rrkItzStgF0An8jIkP/Tl8h/OT U/725+NKgUVLfEW1GmKhZefiD3RdoW+j1XQv0= 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=plTISl7XRgKbWO6zw1c5j3WZeogtjYrXm6i/h/jyEdM=; b=mviz7cYhOiFLaqpt5devYFLt3FT4v9x31LC+e21492kH0ivMGwgwCntPTelZztqZ00 ZOcWTve4DeaNFg4W6HPxCyHzL5VQ2Ye2IHnB4u94W6Bj6UhL0kNfb59ApgV/KbkNB43g 4cULuwQvouTbMLcS5mXCY/jbn6kasiUE74ivfwLQYsUAWrChiAzKMJLjQILR/hCTtEqN goRCFLpedBlWJKzMQ01+axQ1xD5+CvIOCEW9rqwfwuKFnuO2pYqws5GIRx37MENTg0u8 D7fKI04ufdqv3b5BZSRVUaS+dJ7hFhRE34bNkm+mRScgvU7aZwsT2oko48qN6zos4hHg dCuQ== X-Gm-Message-State: APjAAAXGIb25CyFMQCRzwqvs/vAzoeTmx+Bk6/MH/r2KNmoqBFxePBiv /bvXeHdlEvpgZXMqiTfhFhY= X-Received: by 2002:a63:da52:: with SMTP id l18mr11572275pgj.131.1562945674764; Fri, 12 Jul 2019 08:34:34 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id 1sm9736153pfe.102.2019.07.12.08.34.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 08:34:34 -0700 (PDT) Date: Fri, 12 Jul 2019 11:34:32 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Ingo Molnar , Jonathan Corbet , Josh Triplett , kvm-ppc@vger.kernel.org, Lai Jiangshan , linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Mathieu Desnoyers , Michael Ellerman , Paul Mackerras , rcu@vger.kernel.org, Steven Rostedt , byungchul.park@lge.com, kernel-team@android.com Subject: Re: [PATCH] treewide: Rename rcu_dereference_raw_notrace to _check Message-ID: <20190712153432.GC235410@google.com> References: <20190711204541.28940-1-joel@joelfernandes.org> <20190712150107.GT26519@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190712150107.GT26519@linux.ibm.com> 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 08:01:07AM -0700, Paul E. McKenney wrote: > On Thu, Jul 11, 2019 at 04:45:41PM -0400, Joel Fernandes (Google) wrote: > > The rcu_dereference_raw_notrace() API name is confusing. > > It is equivalent to rcu_dereference_raw() except that it also does > > sparse pointer checking. > > > > There are only a few users of rcu_dereference_raw_notrace(). This > > patches renames all of them to be rcu_dereference_raw_check with the > > "check" indicating sparse checking. > > > > Signed-off-by: Joel Fernandes (Google) > > I queued this, but reworked the commit log and fixed a couple of > irritating checkpatch issues that were in the original code. > Does this work for you? Thanks, yes it looks good to me. thanks, - Joel > > Thanx, Paul > > ------------------------------------------------------------------------ > > commit bd5c0fea6016c90cf7a9eb0435cd0c373dfdac2f > Author: Joel Fernandes (Google) > Date: Thu Jul 11 16:45:41 2019 -0400 > > treewide: Rename rcu_dereference_raw_notrace() to _check() > > The rcu_dereference_raw_notrace() API name is confusing. It is equivalent > to rcu_dereference_raw() except that it also does sparse pointer checking. > > There are only a few users of rcu_dereference_raw_notrace(). This patches > renames all of them to be rcu_dereference_raw_check() with the "_check()" > indicating sparse checking. > > Signed-off-by: Joel Fernandes (Google) > [ paulmck: Fix checkpatch warnings about parentheses. ] > Signed-off-by: Paul E. McKenney > > diff --git a/Documentation/RCU/Design/Requirements/Requirements.html b/Documentation/RCU/Design/Requirements/Requirements.html > index f04c467e55c5..467251f7fef6 100644 > --- a/Documentation/RCU/Design/Requirements/Requirements.html > +++ b/Documentation/RCU/Design/Requirements/Requirements.html > @@ -2514,7 +2514,7 @@ disabled across the entire RCU read-side critical section. >

> It is possible to use tracing on RCU code, but tracing itself > uses RCU. > -For this reason, rcu_dereference_raw_notrace() > +For this reason, rcu_dereference_raw_check() > is provided for use by tracing, which avoids the destructive > recursion that could otherwise ensue. > This API is also used by virtualization in some architectures, > diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h > index 21b1ed5df888..53388a311967 100644 > --- a/arch/powerpc/include/asm/kvm_book3s_64.h > +++ b/arch/powerpc/include/asm/kvm_book3s_64.h > @@ -546,7 +546,7 @@ static inline void note_hpte_modification(struct kvm *kvm, > */ > static inline struct kvm_memslots *kvm_memslots_raw(struct kvm *kvm) > { > - return rcu_dereference_raw_notrace(kvm->memslots[0]); > + return rcu_dereference_raw_check(kvm->memslots[0]); > } > > extern void kvmppc_mmu_debugfs_init(struct kvm *kvm); > diff --git a/include/linux/rculist.h b/include/linux/rculist.h > index e91ec9ddcd30..932296144131 100644 > --- a/include/linux/rculist.h > +++ b/include/linux/rculist.h > @@ -622,7 +622,7 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, > * as long as the traversal is guarded by rcu_read_lock(). > */ > #define hlist_for_each_entry_rcu(pos, head, member) \ > - for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\ > + for (pos = hlist_entry_safe(rcu_dereference_raw(hlist_first_rcu(head)),\ > typeof(*(pos)), member); \ > pos; \ > pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\ > @@ -642,10 +642,10 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, > * not do any RCU debugging or tracing. > */ > #define hlist_for_each_entry_rcu_notrace(pos, head, member) \ > - for (pos = hlist_entry_safe (rcu_dereference_raw_notrace(hlist_first_rcu(head)),\ > + for (pos = hlist_entry_safe(rcu_dereference_raw_check(hlist_first_rcu(head)),\ > typeof(*(pos)), member); \ > pos; \ > - pos = hlist_entry_safe(rcu_dereference_raw_notrace(hlist_next_rcu(\ > + pos = hlist_entry_safe(rcu_dereference_raw_check(hlist_next_rcu(\ > &(pos)->member)), typeof(*(pos)), member)) > > /** > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index 0c9b92799abc..e5161e377ad4 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -478,7 +478,7 @@ do { \ > * The no-tracing version of rcu_dereference_raw() must not call > * rcu_read_lock_held(). > */ > -#define rcu_dereference_raw_notrace(p) __rcu_dereference_check((p), 1, __rcu) > +#define rcu_dereference_raw_check(p) __rcu_dereference_check((p), 1, __rcu) > > /** > * rcu_dereference_protected() - fetch RCU pointer when updates prevented > diff --git a/kernel/trace/ftrace_internal.h b/kernel/trace/ftrace_internal.h > index 0515a2096f90..0456e0a3dab1 100644 > --- a/kernel/trace/ftrace_internal.h > +++ b/kernel/trace/ftrace_internal.h > @@ -6,22 +6,22 @@ > > /* > * Traverse the ftrace_global_list, invoking all entries. The reason that we > - * can use rcu_dereference_raw_notrace() is that elements removed from this list > + * can use rcu_dereference_raw_check() is that elements removed from this list > * are simply leaked, so there is no need to interact with a grace-period > - * mechanism. The rcu_dereference_raw_notrace() calls are needed to handle > + * mechanism. The rcu_dereference_raw_check() calls are needed to handle > * concurrent insertions into the ftrace_global_list. > * > * Silly Alpha and silly pointer-speculation compiler optimizations! > */ > #define do_for_each_ftrace_op(op, list) \ > - op = rcu_dereference_raw_notrace(list); \ > + op = rcu_dereference_raw_check(list); \ > do > > /* > * Optimized for just a single item in the list (as that is the normal case). > */ > #define while_for_each_ftrace_op(op) \ > - while (likely(op = rcu_dereference_raw_notrace((op)->next)) && \ > + while (likely(op = rcu_dereference_raw_check((op)->next)) && \ > unlikely((op) != &ftrace_list_end)) > > extern struct ftrace_ops __rcu *ftrace_ops_list; > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index 2c92b3d9ea30..1d69110d9e5b 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -2642,10 +2642,10 @@ static void ftrace_exports(struct ring_buffer_event *event) > > preempt_disable_notrace(); > > - export = rcu_dereference_raw_notrace(ftrace_exports_list); > + export = rcu_dereference_raw_check(ftrace_exports_list); > while (export) { > trace_process_export(export, event); > - export = rcu_dereference_raw_notrace(export->next); > + export = rcu_dereference_raw_check(export->next); > } > > preempt_enable_notrace();