Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp26145yba; Wed, 3 Apr 2019 03:49:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKztzwKzTm8QJaYaERv86pTes5f7g0VSNKpthshQeCB9iXz20MgxzgJm7D1T7za5mjsod8 X-Received: by 2002:a17:902:b597:: with SMTP id a23mr23279237pls.284.1554288594993; Wed, 03 Apr 2019 03:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554288594; cv=none; d=google.com; s=arc-20160816; b=0TtsPhv27URKusBKJttDQErr7d+5g/UisyH7PDnCMuvLegT8nOJxWhdTeOIoJ9BGZx er4V1UFu9B5Sz+D2nPcMO+KkpmAlnuYNML7vKAwrHaYUay8guB5V2ABHPEC/lOk8sOB/ UMPrPATcI8YMXTJlyn6+UyF9qgtQ+96E6S/3HBywcbXe5d0p0Pa8wOvbP1fTRwXs8dvI HJUPFE8/niPY3qYOoqJsXA+5fV3ra9LSwRZz6eJLRTBJxeTw6zkq0JfY+7P/MxAJhaXF 1jc9HaVT+mcZ8JJlAT+qeqf8JPtcHx0jAyo8hfDa37JlKI4ugBixiE5p67VPPsvvS0Lv rQrw== 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=5yuiTdjaGcYAcDx3DFzqJsKL8s0zvI/EH01lLQ90jgs=; b=WxhsYBgnHJMMBgE+GShBGy8u2dLL87t2EI1pchOA1MQNnLvDgq2tcPebjyJn2ATeUH IOLjU2njQiDup0VbFi78vbapr3C0CYzmOUNa9eImFHRqyUt/L2S3y2mImV2lgxFoE+0A q7fzTBwFQnDOiRQIaKveeghrisiPLuX17uwEhkQoczAUvwe0ZJAKNq8CiKuU9fMZQjod aYN40oe1e8eGgzGkWsHEYNZztwqbAY+vIyeXemO+ZKr7PwCqqIkmKTKIrccc3jMv0AUC mihSX0AcJLlkW8KZ2HxTS53SUJUInb58OTdoNHkEiraiu5jm2MuUodRDoF6vUKbg9uke WBsg== 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 gn11si13360515plb.205.2019.04.03.03.49.40; Wed, 03 Apr 2019 03:49:54 -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 S1726582AbfDCKrE (ORCPT + 99 others); Wed, 3 Apr 2019 06:47:04 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37507 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbfDCKrD (ORCPT ); Wed, 3 Apr 2019 06:47:03 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x33AkEFj1815062 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 3 Apr 2019 03:46:14 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x33AkD881815055; Wed, 3 Apr 2019 03:46:13 -0700 Date: Wed, 3 Apr 2019 03:46:13 -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: mingo@kernel.org, tglx@linutronix.de, rostedt@goodmis.org, josh@joshtriplett.org, luc.vanoostenryck@gmail.com, efault@gmx.de, joel@joelfernandes.org, torvalds@linux-foundation.org, hpa@zytor.com, jiangshanlai@gmail.com, morten.rasmussen@arm.com, linux-kernel@vger.kernel.org, paulmck@linux.ibm.com, mathieu.desnoyers@efficios.com, peterz@infradead.org Reply-To: joel@joelfernandes.org, efault@gmx.de, luc.vanoostenryck@gmail.com, josh@joshtriplett.org, rostedt@goodmis.org, tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org, mathieu.desnoyers@efficios.com, paulmck@linux.ibm.com, linux-kernel@vger.kernel.org, morten.rasmussen@arm.com, hpa@zytor.com, jiangshanlai@gmail.com, torvalds@linux-foundation.org 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: b10abd0a8859493a93c6b8020f2be2587557749d 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: b10abd0a8859493a93c6b8020f2be2587557749d Gitweb: https://git.kernel.org/tip/b10abd0a8859493a93c6b8020f2be2587557749d Author: Joel Fernandes (Google) AuthorDate: Wed, 20 Mar 2019 20:34:23 -0400 Committer: Ingo Molnar CommitDate: Wed, 3 Apr 2019 12:34:31 +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.