Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2126723yba; Wed, 3 Apr 2019 01:42:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLS7xOStKBaehWpldBbR5ZzawRR1tqCw/qKYV27fE2N1+HqrspnmcmTaZS9QV9C04h7yOg X-Received: by 2002:a17:902:ba8b:: with SMTP id k11mr66964401pls.40.1554280977515; Wed, 03 Apr 2019 01:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554280977; cv=none; d=google.com; s=arc-20160816; b=Ke10lpG0S/e/Wzxz1UzuXpmR36mXeEt3DyvzeBKg19h65tvP3Mj+P30rdyP+dDHHsi N2Pi2FT0Yp+zQI8+MbcWwU3yODXycvPH5gFDqparylQDAb+6Xvr0fop0RM5kKkL4G9q2 fCfdKPkzHEob72XXfGSBsATdj8sb0hmc29+JUmp+WwahLps4fFtwYOTGpPyUap3MHc4d L55AlwHtO7Bkvs4Vp1gdc+Kd2cHULkF+tlh9z3sNy7GCefoegexrEF7devCu3Eeta3qd eMOCGTtqCQFYF18gd48IIxmaZ6WMzYftB55Rg/Ar2J4+psg53znLtF8686tYoMiP+hUk ++GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=D5SWvMSIg7lA4X38SCYYO8vJbn20vPRpvz3XtS03tmE=; b=hdHSLngW2xC8opaflNxfPG4owJ/MNTsB9+dM+zSLC5ivn9FunoBS7lWQBPVQ4bBgK5 KJqHpVfzX3vfoHbS6n5Ic8czcmaifnju/qkKrqtYpl5e12DjusHml4LxbhmBvsOcqkm5 U9lgKAHuaxyLn7Ncm4SU/wwFwG3Fb1IuFRzU9OLBZk1PkgG7tjzyz4KKukYqtU761XaW 9RJZlo+Px2S5FJbLQnIEpA18r4exm60wNrMVLFkbUshj3kRvWe8A0bExQCaII/nHlHJ/ iiyB/JWZH0LvQfw3B174kKvJ9zFudURn7/t4HxLWev1UOAwI3wCsOd66AhE9y9NpVy52 rupg== ARC-Authentication-Results: i=1; mx.google.com; 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 be8si13429355plb.72.2019.04.03.01.42.42; Wed, 03 Apr 2019 01:42:57 -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; 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 S1729071AbfDCIkR (ORCPT + 99 others); Wed, 3 Apr 2019 04:40:17 -0400 Received: from terminus.zytor.com ([198.137.202.136]:53601 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726084AbfDCIkQ (ORCPT ); Wed, 3 Apr 2019 04:40:16 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x338dJS21775068 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 3 Apr 2019 01:39:19 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x338dJbd1775065; Wed, 3 Apr 2019 01:39:19 -0700 Date: Wed, 3 Apr 2019 01:39:19 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: "tip-bot for Joel Fernandes (Google)" Message-ID: Cc: morten.rasmussen@arm.com, josh@joshtriplett.org, jiangshanlai@gmail.com, mingo@kernel.org, torvalds@linux-foundation.org, joel@joelfernandes.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, efault@gmx.de, mathieu.desnoyers@efficios.com, hpa@zytor.com, tglx@linutronix.de, peterz@infradead.org, luc.vanoostenryck@gmail.com, paulmck@linux.ibm.com Reply-To: morten.rasmussen@arm.com, mingo@kernel.org, jiangshanlai@gmail.com, josh@joshtriplett.org, torvalds@linux-foundation.org, tglx@linutronix.de, efault@gmx.de, hpa@zytor.com, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, joel@joelfernandes.org, peterz@infradead.org, luc.vanoostenryck@gmail.com, paulmck@linux.ibm.com In-Reply-To: <20190321003426.160260-2-joel@joelfernandes.org> References: <20190321003426.160260-2-joel@joelfernandes.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/cpufreq: Annotate cpufreq_update_util_data pointer with __rcu Git-Commit-ID: 8f9affdf4094bde418a0dbd8b52bb503ee486469 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,BAYES_00, FREEMAIL_FORGED_REPLYTO autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 8f9affdf4094bde418a0dbd8b52bb503ee486469 Gitweb: https://git.kernel.org/tip/8f9affdf4094bde418a0dbd8b52bb503ee486469 Author: Joel Fernandes (Google) AuthorDate: Wed, 20 Mar 2019 20:34:23 -0400 Committer: Ingo Molnar CommitDate: Wed, 3 Apr 2019 09:51:01 +0200 sched/cpufreq: Annotate cpufreq_update_util_data pointer with __rcu Recently I added an RCU annotation check to rcu_assign_pointer(). All pointers assigned to RCU protected data are to be annotated with __rcu inorder to be able to use rcu_assign_pointer() similar to checks in other RCU APIs. This resulted in a sparse error: kernel//sched/cpufreq.c:41:9: sparse: error: incompatible types in comparison expression (different address spaces) Fix this by annotating cpufreq_update_util_data pointer with __rcu. This will also help sparse catch any future RCU misuage bugs. Signed-off-by: Joel Fernandes (Google) [ From an RCU perspective. ] Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paul E. McKenney Cc: Josh Triplett Cc: Lai Jiangshan Cc: Linus Torvalds Cc: Luc Van Oostenryck Cc: Mathieu Desnoyers Cc: Mike Galbraith Cc: Morten Rasmussen Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Cc: keescook@chromium.org Cc: kernel-hardening@lists.openwall.com Cc: kernel-team@android.com Link: https://lkml.kernel.org/r/20190321003426.160260-2-joel@joelfernandes.org Signed-off-by: Ingo Molnar --- kernel/sched/cpufreq.c | 2 +- kernel/sched/sched.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/cpufreq.c b/kernel/sched/cpufreq.c index 835671f0f917..b5dcd1d83c7f 100644 --- a/kernel/sched/cpufreq.c +++ b/kernel/sched/cpufreq.c @@ -7,7 +7,7 @@ */ #include "sched.h" -DEFINE_PER_CPU(struct update_util_data *, cpufreq_update_util_data); +DEFINE_PER_CPU(struct update_util_data __rcu *, cpufreq_update_util_data); /** * cpufreq_add_update_util_hook - Populate the CPU's update_util_data pointer. diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index efa686eeff26..713715dd00cf 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2185,7 +2185,7 @@ static inline u64 irq_time_read(int cpu) #endif /* CONFIG_IRQ_TIME_ACCOUNTING */ #ifdef CONFIG_CPU_FREQ -DECLARE_PER_CPU(struct update_util_data *, cpufreq_update_util_data); +DECLARE_PER_CPU(struct update_util_data __rcu *, cpufreq_update_util_data); /** * cpufreq_update_util - Take a note about CPU utilization changes.