Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6486713ybv; Wed, 12 Feb 2020 13:14:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwkK7k1EZPKV9yfX2LRINgV9Bt/y0H8ieglvopDpGNQui0gBexhbdX0yf1oWiWTZLaa6iml X-Received: by 2002:aca:5303:: with SMTP id h3mr695532oib.109.1581542078743; Wed, 12 Feb 2020 13:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581542078; cv=none; d=google.com; s=arc-20160816; b=krQulaNXcBpLcMzUJ23WK+uJJ6WV9pK3FUbnFEkkcBbvDwHmUUMGpASRTHwx1yGDHb fBPRIS/hQsPcWUXVjpKW3pyTEYZYoQSjOyVESMJw/QXqjaQhCViM45ofdg2RM50cvFxF vcEAU8KOn55Miqq6rIaIpdj//3l6T547v03HiCuRD1J6Bskydd6wnFQHvnw7Zd4G0k3J vWp0464uXMiOpf7ADoQkNiHtTj3aLGiAr6ffKKrNPHFv3sxiC7M3OZXnkUE7ErSTAvzN hU15XoCPG9uXpmNlTze7zIm8ffq/z+2dVmhilLy62Fxm8gw/2UcZjzRrjJzPQjRf8hxP QuPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id:dkim-signature; bh=ti0S9PqF1q37bWzsVIQzNsLffkLlJSMqLEw26r2NISk=; b=QvJJdenW5DEAino2g4bDHKZi918jW1bzy8oqdFVlbSau3j38duWQiG1OIrFk8Af52d 7UfbbotPA2+7rHFkmMA6BGAW07W8Ff5l+ntc0HVDCod5zOxzI8js32idtWn5j8wkm1Qv SbHGit2e2aFstfdVXGA07PsMPg8QzHXF8cSENtWwiC2sCrbC/5sy6DNpi5hijrbS92vX lDR+h8NUy6WdTja2ZIUDFgpYjyFGZs3BOO3165l2WctvButvyJxIB79Q99YMzkz9qGka 36RNNt8SdmPp9DzSIFmj9QpLIZc+/o9NTPVg92dlvGDOt85zj0zSzEqd+ClLh27HfHl5 W2aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iBTClOav; 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 x72si136750oia.194.2020.02.12.13.14.26; Wed, 12 Feb 2020 13:14:38 -0800 (PST) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iBTClOav; 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 S1729163AbgBLVOH (ORCPT + 99 others); Wed, 12 Feb 2020 16:14:07 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:45052 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729103AbgBLVOF (ORCPT ); Wed, 12 Feb 2020 16:14:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=ti0S9PqF1q37bWzsVIQzNsLffkLlJSMqLEw26r2NISk=; b=iBTClOavJKxJmeC/A3Uf9l/PLm 1u0u2i2XvDEIaf3R0PhjAZgGmhKs5UHJa1iP/gzbnyaHDfiOVwuH9cGLgGzg6t46FPWEQTOj/GkjO aCxLldwJCMsIOCQu0dcbwwa4LDYIYY9Q6R+l+P9LZrz4DF2vMLsjRW4iCtwMv3MlBapSnzpTAGain g7B6b4q3cA9Ay2M8JdCXl7dQpOTmW0P0081IqWoBWsl4ujErYAfOGIkCeAHW9U3vGiDVJWy5oMasE 3lcyLYJZPQ/dOsQKuFQNLauKzbrbagGpe4OGkeMmhGZ2CKAc13PyYLuu9XAer10wTPeLNl2NrSGJD OzjxsMmQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1zKM-0001B0-C9; Wed, 12 Feb 2020 21:13:46 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5B41D306BCF; Wed, 12 Feb 2020 22:11:52 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 751AD202BC5A2; Wed, 12 Feb 2020 22:13:41 +0100 (CET) Message-Id: <20200212210749.858223764@infradead.org> User-Agent: quilt/0.65 Date: Wed, 12 Feb 2020 22:01:40 +0100 From: Peter Zijlstra To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, rostedt@goodmis.org Cc: peterz@infradead.org, mingo@kernel.org, joel@joelfernandes.org, gregkh@linuxfoundation.org, gustavo@embeddedor.com, tglx@linutronix.de, paulmck@kernel.org, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com Subject: [PATCH v2 1/9] rcu: Rename rcu_irq_{enter,exit}_irqson() References: <20200212210139.382424693@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The functions do in fact use local_irq_{save,restore}() and can therefore be used when IRQs are in fact disabled. Worse, they are already used in places where IRQs are disabled, leading to great confusion when reading the code. Rename them to fix this confusion. Signed-off-by: Peter Zijlstra (Intel) --- include/linux/rcupdate.h | 4 ++-- include/linux/rcutiny.h | 4 ++-- include/linux/rcutree.h | 4 ++-- include/linux/tracepoint.h | 4 ++-- kernel/cpu_pm.c | 4 ++-- kernel/rcu/tree.c | 8 ++++---- kernel/trace/trace.c | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -120,9 +120,9 @@ static inline void rcu_init_nohz(void) { */ #define RCU_NONIDLE(a) \ do { \ - rcu_irq_enter_irqson(); \ + rcu_irq_enter_irqsave(); \ do { a; } while (0); \ - rcu_irq_exit_irqson(); \ + rcu_irq_exit_irqsave(); \ } while (0) /* --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h @@ -68,8 +68,8 @@ static inline int rcu_jiffies_till_stall static inline void rcu_idle_enter(void) { } static inline void rcu_idle_exit(void) { } static inline void rcu_irq_enter(void) { } -static inline void rcu_irq_exit_irqson(void) { } -static inline void rcu_irq_enter_irqson(void) { } +static inline void rcu_irq_exit_irqsave(void) { } +static inline void rcu_irq_enter_irqsave(void) { } static inline void rcu_irq_exit(void) { } static inline void exit_rcu(void) { } static inline bool rcu_preempt_need_deferred_qs(struct task_struct *t) --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h @@ -46,8 +46,8 @@ void rcu_idle_enter(void); void rcu_idle_exit(void); void rcu_irq_enter(void); void rcu_irq_exit(void); -void rcu_irq_enter_irqson(void); -void rcu_irq_exit_irqson(void); +void rcu_irq_enter_irqsave(void); +void rcu_irq_exit_irqsave(void); void exit_rcu(void); --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -181,7 +181,7 @@ static inline struct tracepoint *tracepo */ \ if (rcuidle) { \ __idx = srcu_read_lock_notrace(&tracepoint_srcu);\ - rcu_irq_enter_irqson(); \ + rcu_irq_enter_irqsave(); \ } \ \ it_func_ptr = rcu_dereference_raw((tp)->funcs); \ @@ -195,7 +195,7 @@ static inline struct tracepoint *tracepo } \ \ if (rcuidle) { \ - rcu_irq_exit_irqson(); \ + rcu_irq_exit_irqsave(); \ srcu_read_unlock_notrace(&tracepoint_srcu, __idx);\ } \ \ --- a/kernel/cpu_pm.c +++ b/kernel/cpu_pm.c @@ -24,10 +24,10 @@ static int cpu_pm_notify(enum cpu_pm_eve * could be disfunctional in cpu idle. Copy RCU_NONIDLE code to let * RCU know this. */ - rcu_irq_enter_irqson(); + rcu_irq_enter_irqsave(); ret = __atomic_notifier_call_chain(&cpu_pm_notifier_chain, event, NULL, nr_to_call, nr_calls); - rcu_irq_exit_irqson(); + rcu_irq_exit_irqsave(); return notifier_to_errno(ret); } --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -699,10 +699,10 @@ void rcu_irq_exit(void) /* * Wrapper for rcu_irq_exit() where interrupts are enabled. * - * If you add or remove a call to rcu_irq_exit_irqson(), be sure to test + * If you add or remove a call to rcu_irq_exit_irqsave(), be sure to test * with CONFIG_RCU_EQS_DEBUG=y. */ -void rcu_irq_exit_irqson(void) +void rcu_irq_exit_irqsave(void) { unsigned long flags; @@ -875,10 +875,10 @@ void rcu_irq_enter(void) /* * Wrapper for rcu_irq_enter() where interrupts are enabled. * - * If you add or remove a call to rcu_irq_enter_irqson(), be sure to test + * If you add or remove a call to rcu_irq_enter_irqsave(), be sure to test * with CONFIG_RCU_EQS_DEBUG=y. */ -void rcu_irq_enter_irqson(void) +void rcu_irq_enter_irqsave(void) { unsigned long flags; --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -3004,9 +3004,9 @@ void __trace_stack(struct trace_array *t if (unlikely(in_nmi())) return; - rcu_irq_enter_irqson(); + rcu_irq_enter_irqsave(); __ftrace_trace_stack(buffer, flags, skip, pc, NULL); - rcu_irq_exit_irqson(); + rcu_irq_exit_irqsave(); } /**