From patchwork Thu Mar 21 00:34:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10862735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2E76139A for ; Thu, 21 Mar 2019 00:35:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA9BB29E99 for ; Thu, 21 Mar 2019 00:35:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB92C29EEC; Thu, 21 Mar 2019 00:35:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 0974929E99 for ; Thu, 21 Mar 2019 00:35:11 +0000 (UTC) Received: (qmail 24257 invoked by uid 550); 21 Mar 2019 00:35:03 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 24094 invoked from network); 21 Mar 2019 00:35:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VXwps16vASwoCwctvt+c7hXAgg4xM5xUnznKf8pbr4E=; b=F+wz+KBU6c5XYVr/XcGDyV8lbJqiOM6t2n2UMRjLGYEIzbqDnCXLYtyMgsA1jQ2bQn GgFFejHln14tX5vHSLeCEAW1tHV/ESEx6IoFxdMXP2NMF/jY59mukSwgijpo+z5nJTPk 3qL6iVy/YQQWkqwwADVfoo7cDFIVUbNehoA3E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VXwps16vASwoCwctvt+c7hXAgg4xM5xUnznKf8pbr4E=; b=Q1tTux/oZW/w9XE6/YIuF9v5f6j7LuD1AGtwh5fCUgjFr/kCjDSGtAzztXS+U4qzPQ M8IBNvt2hLgy/Y/rL2hc+61wDTpIK26z+IF+jFNpMo4paP2E/dd/dFfSZUKFAU+iwX9+ kh8hXzrJCDQvwZl6c8APYnUVUE7ddKyg85BlijDJkUFC8/uNwwMnsnubI3dpGjeCL7d+ wEb7/HPHqUF700C4SZwC2AQndp9N45OdQkYSyvT6nQO8YXuXMIqXPqyrOnI5YhJrcL98 FyS3p8c+s52dp+Z3ozvRswgSzMqpEsIin/f2/O+889pP4FLr+Lz3rKZNKORqXPBP42zX j+tg== X-Gm-Message-State: APjAAAXoCVfT4G5rbipbd7frL4CthzyOGhdCGz3M5CCR6J1Ks6iTUREV 3+KWo7Az8fNOmUzlVhdCol0ZdA== X-Google-Smtp-Source: APXvYqxOrY9pxSJR9LMG73HalrbnXN5RofP5xjcWc9GfONoexUhjKRrzzIdMjcZl5HeL2MvlhfK9NQ== X-Received: by 2002:aed:20e3:: with SMTP id 90mr624928qtb.357.1553128491194; Wed, 20 Mar 2019 17:34:51 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , "Paul E . McKenney" , Ingo Molnar , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, kernel-team@android.com, Lai Jiangshan , Luc Van Oostenryck , Mathieu Desnoyers , Morten Rasmussen , Peter Zijlstra , rcu@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 1/4] sched/cpufreq: Annotate cpufreq_update_util_data pointer with __rcu Date: Wed, 20 Mar 2019 20:34:23 -0400 Message-Id: <20190321003426.160260-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.21.0.225.g810b269d1ac-goog In-Reply-To: <20190321003426.160260-1-joel@joelfernandes.org> References: <20190321003426.160260-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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. [From an RCU perspective] Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- 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. From patchwork Thu Mar 21 00:34:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10862739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50E0A15AC for ; Thu, 21 Mar 2019 00:35:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35F0129E99 for ; Thu, 21 Mar 2019 00:35:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A3A329EEC; Thu, 21 Mar 2019 00:35:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id E066B29E99 for ; Thu, 21 Mar 2019 00:35:18 +0000 (UTC) Received: (qmail 24467 invoked by uid 550); 21 Mar 2019 00:35:05 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 24343 invoked from network); 21 Mar 2019 00:35:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3DYNvRjo/HuWAfPzKwiaae98YACyxnfggO4JrZh0pqc=; b=b2m+E2rBIWrjAEK7ksC+kUdda6i79l+OAnqTq4Nh+wMfEJZEL78oIKpbExSGNTsbjS QgODnchgWoidxWeW7gCR6+pyoOPVkGgcqBYXflx61USkvWOpf2mw30X6HA2uqNuUja6N zBbTar2Vbof5pPo/Ul2SVXB1PoWCvUgckJ0U0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3DYNvRjo/HuWAfPzKwiaae98YACyxnfggO4JrZh0pqc=; b=BpbJA1hLUuccJO6EA/UYerh/wupbzc6GBH70+WU2Atlu7d79R+eQRvRcAe0FuEu5Pa fdMMar1ST1BRIKGlwXcwXpGPDf9DnyHWuHqLl/lH5ZCGH2G9jBt3Dc9LHcoHiPq0c+ia Pgs7mnEKOp0Ydbv1Gw2gAesX2iMTvHKj9iaglzWfI3WoCRg8AHctXWxQ5Sb049LrQszL W74jQQvQpvz9jIbSEAJ26mUwVRla0AauGVbzWwzQPXVdkicH57inMuHmEejICxzcthu+ 8JvBeqGoC4pyNW5ra2q7Jtw87KC2GRPmHh9XJz6LZWJ/zeLjw5Z7c3WcYxN5MZMEzNWS yWwQ== X-Gm-Message-State: APjAAAWiJ7OeBctooc65XgXhI3d6/nsC0zXNxzDKd+OUgjVhpsdOUeTP E0YS4kUdxdS9b0Z+mFiZI6GosQ== X-Google-Smtp-Source: APXvYqxHYc6IcQHMWIULRulGndrlcJYc90PK4ZArKF2CW4dAOuOnIN93yfvj1vApt5VMlyPuYm41gw== X-Received: by 2002:a0c:94d0:: with SMTP id k16mr813759qvk.158.1553128492678; Wed, 20 Mar 2019 17:34:52 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , "Paul E . McKenney" , Ingo Molnar , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, kernel-team@android.com, Lai Jiangshan , Luc Van Oostenryck , Mathieu Desnoyers , Morten Rasmussen , Peter Zijlstra , rcu@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 2/4] sched_domain: Annotate RCU pointers properly Date: Wed, 20 Mar 2019 20:34:24 -0400 Message-Id: <20190321003426.160260-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.21.0.225.g810b269d1ac-goog In-Reply-To: <20190321003426.160260-1-joel@joelfernandes.org> References: <20190321003426.160260-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP The scheduler uses RCU API in various places to access sched_domain pointers. These cause sparse errors as below. Many new errors show up because of an annotation check I added to rcu_assign_pointer(). Let us annotate the pointers correctly which also will help sparse catch any potential future bugs. This fixes the following sparse errors: rt.c:1681:9: error: incompatible types in comparison expression deadline.c:1904:9: error: incompatible types in comparison expression core.c:519:9: error: incompatible types in comparison expression core.c:1634:17: error: incompatible types in comparison expression fair.c:6193:14: error: incompatible types in comparison expression fair.c:9883:22: error: incompatible types in comparison expression fair.c:9897:9: error: incompatible types in comparison expression sched.h:1287:9: error: incompatible types in comparison expression topology.c:612:9: error: incompatible types in comparison expression topology.c:615:9: error: incompatible types in comparison expression sched.h:1300:9: error: incompatible types in comparison expression topology.c:618:9: error: incompatible types in comparison expression sched.h:1287:9: error: incompatible types in comparison expression topology.c:621:9: error: incompatible types in comparison expression sched.h:1300:9: error: incompatible types in comparison expression topology.c:624:9: error: incompatible types in comparison expression topology.c:671:9: error: incompatible types in comparison expression stats.c:45:17: error: incompatible types in comparison expression fair.c:5998:15: error: incompatible types in comparison expression fair.c:5989:15: error: incompatible types in comparison expression fair.c:5998:15: error: incompatible types in comparison expression fair.c:5989:15: error: incompatible types in comparison expression fair.c:6120:19: error: incompatible types in comparison expression fair.c:6506:14: error: incompatible types in comparison expression fair.c:6515:14: error: incompatible types in comparison expression fair.c:6623:9: error: incompatible types in comparison expression fair.c:5970:17: error: incompatible types in comparison expression fair.c:8642:21: error: incompatible types in comparison expression fair.c:9253:9: error: incompatible types in comparison expression fair.c:9331:9: error: incompatible types in comparison expression fair.c:9519:15: error: incompatible types in comparison expression fair.c:9533:14: error: incompatible types in comparison expression fair.c:9542:14: error: incompatible types in comparison expression fair.c:9567:14: error: incompatible types in comparison expression fair.c:9597:14: error: incompatible types in comparison expression fair.c:9421:16: error: incompatible types in comparison expression fair.c:9421:16: error: incompatible types in comparison expression [From an RCU perspective] Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- include/linux/sched/topology.h | 4 ++-- kernel/sched/sched.h | 14 +++++++------- kernel/sched/topology.c | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 57c7ed3fe465..cfc0a89a7159 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -76,8 +76,8 @@ struct sched_domain_shared { struct sched_domain { /* These fields must be setup */ - struct sched_domain *parent; /* top domain must be null terminated */ - struct sched_domain *child; /* bottom domain must be null terminated */ + struct sched_domain __rcu *parent; /* top domain must be null terminated */ + struct sched_domain __rcu *child; /* bottom domain must be null terminated */ struct sched_group *groups; /* the balancing groups of the domain */ unsigned long min_interval; /* Minimum balance interval ms */ unsigned long max_interval; /* Maximum balance interval ms */ diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 713715dd00cf..2b452d68ab2e 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -869,8 +869,8 @@ struct rq { atomic_t nr_iowait; #ifdef CONFIG_SMP - struct root_domain *rd; - struct sched_domain *sd; + struct root_domain *rd; + struct sched_domain __rcu *sd; unsigned long cpu_capacity; unsigned long cpu_capacity_orig; @@ -1324,13 +1324,13 @@ static inline struct sched_domain *lowest_flag_domain(int cpu, int flag) return sd; } -DECLARE_PER_CPU(struct sched_domain *, sd_llc); +DECLARE_PER_CPU(struct sched_domain __rcu *, sd_llc); DECLARE_PER_CPU(int, sd_llc_size); DECLARE_PER_CPU(int, sd_llc_id); -DECLARE_PER_CPU(struct sched_domain_shared *, sd_llc_shared); -DECLARE_PER_CPU(struct sched_domain *, sd_numa); -DECLARE_PER_CPU(struct sched_domain *, sd_asym_packing); -DECLARE_PER_CPU(struct sched_domain *, sd_asym_cpucapacity); +DECLARE_PER_CPU(struct sched_domain_shared __rcu *, sd_llc_shared); +DECLARE_PER_CPU(struct sched_domain __rcu *, sd_numa); +DECLARE_PER_CPU(struct sched_domain __rcu *, sd_asym_packing); +DECLARE_PER_CPU(struct sched_domain __rcu *, sd_asym_cpucapacity); extern struct static_key_false sched_asym_cpucapacity; struct sched_group_capacity { diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index ab7f371a3a17..64bec54ded3e 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -615,13 +615,13 @@ static void destroy_sched_domains(struct sched_domain *sd) * the cpumask of the domain), this allows us to quickly tell if * two CPUs are in the same cache domain, see cpus_share_cache(). */ -DEFINE_PER_CPU(struct sched_domain *, sd_llc); +DEFINE_PER_CPU(struct sched_domain __rcu *, sd_llc); DEFINE_PER_CPU(int, sd_llc_size); DEFINE_PER_CPU(int, sd_llc_id); -DEFINE_PER_CPU(struct sched_domain_shared *, sd_llc_shared); -DEFINE_PER_CPU(struct sched_domain *, sd_numa); -DEFINE_PER_CPU(struct sched_domain *, sd_asym_packing); -DEFINE_PER_CPU(struct sched_domain *, sd_asym_cpucapacity); +DEFINE_PER_CPU(struct sched_domain_shared __rcu *, sd_llc_shared); +DEFINE_PER_CPU(struct sched_domain __rcu *, sd_numa); +DEFINE_PER_CPU(struct sched_domain __rcu *, sd_asym_packing); +DEFINE_PER_CPU(struct sched_domain __rcu *, sd_asym_cpucapacity); DEFINE_STATIC_KEY_FALSE(sched_asym_cpucapacity); static void update_top_cache_domain(int cpu) From patchwork Thu Mar 21 00:34:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10862741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 231CF139A for ; Thu, 21 Mar 2019 00:35:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C2EF29E99 for ; Thu, 21 Mar 2019 00:35:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3F7D29EEC; Thu, 21 Mar 2019 00:35:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 4177C29E99 for ; Thu, 21 Mar 2019 00:35:27 +0000 (UTC) Received: (qmail 25633 invoked by uid 550); 21 Mar 2019 00:35:07 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 24495 invoked from network); 21 Mar 2019 00:35:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IC0+CtzpXGHhz69/AjInC3kSHyrQxff0OCscI7M8m1k=; b=IMN3oviFXuoURkXevt9lKXvEeYfyhNQHi8wgNDFVtGKzqa5oayf5HKfpSpy8fvePCp zkkJfKAaIwPVxZWnksglQ9TK2M1aupaojK0EVDMcB/GbvNOvxQHv6qI1fBp96JRFIyQL IPSkPNdEZHfdqWmLrAResI2wRxRPGHwZa9sZE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IC0+CtzpXGHhz69/AjInC3kSHyrQxff0OCscI7M8m1k=; b=KQl/wa/cO8J/cPALDl3WoWxD+SbAp31ZOcnYqH82TaVrlof6ZZcZDw8MdarJnQibNM SRPe59LxcUH5ykYVoahqb0spufpIwMxKIjdPhxg180O52MjSdDsBCcw6+z8UEAvqiM2L hpFwA79Sg+xPLCEx01xjVP0JPm/YOM7TeCPCAlmqC8+dYPOT1L12i36FpXMOgOINWmeM 2em4F6oNikNcqGU2WXWOZP3BxUnSdqbEeZYQJ3SXa5uAPC1xnLQG28ifrfIyn9Q0YeFp aKeLKv1sDbz28EfbFrf06tmf8fIhUSwTd2Y36hElwv8BHt93up3bfJV9MKDsOuh8+5Gm oojg== X-Gm-Message-State: APjAAAUAGB4QLN1Iih42JTFEqnhmj1MOqehNca7/5NoltlsQjGdj1dxD Boz7IGjyE/0CRfgy615t/JOgYg== X-Google-Smtp-Source: APXvYqzW1ItlokDxvifd5fwoA/cXTdAYbCDJNxmjIBAACop7r9u618kPeesEna9EnhvcgqKDOdYwxQ== X-Received: by 2002:a37:784:: with SMTP id 126mr471424qkh.10.1553128494280; Wed, 20 Mar 2019 17:34:54 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , "Paul E . McKenney" , Ingo Molnar , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, kernel-team@android.com, Lai Jiangshan , Luc Van Oostenryck , Mathieu Desnoyers , Morten Rasmussen , Peter Zijlstra , rcu@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 3/4] rcuwait: Annotate task_struct with __rcu Date: Wed, 20 Mar 2019 20:34:25 -0400 Message-Id: <20190321003426.160260-4-joel@joelfernandes.org> X-Mailer: git-send-email 2.21.0.225.g810b269d1ac-goog In-Reply-To: <20190321003426.160260-1-joel@joelfernandes.org> References: <20190321003426.160260-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP This suppresses sparse error generated due to the recently added rcu_assign_pointer sparse check. percpu-rwsem.c:162:9: sparse: error: incompatible types in comparison expression exit.c:316:16: sparse: error: incompatible types in comparison expression [From an RCU perspective] Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- include/linux/rcuwait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h index 90bfa3279a01..563290fc194f 100644 --- a/include/linux/rcuwait.h +++ b/include/linux/rcuwait.h @@ -18,7 +18,7 @@ * awoken. */ struct rcuwait { - struct task_struct *task; + struct task_struct __rcu *task; }; #define __RCUWAIT_INITIALIZER(name) \ From patchwork Thu Mar 21 00:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10862743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCA8A15AC for ; Thu, 21 Mar 2019 00:35:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6B9129E99 for ; Thu, 21 Mar 2019 00:35:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A50829EEC; Thu, 21 Mar 2019 00:35:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id DAF4129ECD for ; Thu, 21 Mar 2019 00:35:35 +0000 (UTC) Received: (qmail 25687 invoked by uid 550); 21 Mar 2019 00:35:08 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 25641 invoked from network); 21 Mar 2019 00:35:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3BCZ1lsacTsgFMuBPjIGWwMmDsstTbo8DviFJ0mb0ag=; b=c8SEnqX2KnNGVEDjz3mPiFXvsItfq9cY17AoP/PqrLOJoo+mXC/uhYUvFoBy7yilKw TK71+HYMsAiIkyIV73LQ73LS4IKvd1kRgfgdV0tzLw0EBuO3ZwXzDV0IwLHyc+5SrODd 3zGUlL1yuhuOrnAn77h6Wc7VCU6UZr4SlQ+3A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3BCZ1lsacTsgFMuBPjIGWwMmDsstTbo8DviFJ0mb0ag=; b=cSicugUQnCfax7117Re1XvqDijTD07FI5UfrXyas3F1qjPrrYz3jHwo6KEJkAPgjVj 8k2ptW5ZR9ObE9T5g59OV61tMY3iSTk9o7N8G4lLTR8KnHD6elCwMJZB08TyTBLN9fZH 0Ekrs2gnDj7FUZYP4oOD6ShVIdf5Zftn0SFTlSRueafVkh3K7Fls6C5bHGg7hjxLuxIX l/p+iS72NqMJdtYDRvKzt/B8uNZhY39hOx177pbALDgsr4jpukhEyVKVuli23XqOgX2R aqLjwnhrKwwT9Adhe7Agio9HpSqX27xDQA0tUHmxAPEPD1CV4Ou6h4W7B31NG/X300aU NDaQ== X-Gm-Message-State: APjAAAVPFpr4HQ1mDJuO+GvN2jOpUzzj7x5F1AjCVpAMYWVdZW4imLLk JH7/+X9dAmaBmiUkBgN5xp5X/Q== X-Google-Smtp-Source: APXvYqyKz8eiuiukjGWMlz2K1RtXcTv8xyeBJgywnaCkw86IBcuZ7HUWbRdeFpvB2XfJCP47FOijMw== X-Received: by 2002:a0c:b05c:: with SMTP id l28mr757047qvc.95.1553128495754; Wed, 20 Mar 2019 17:34:55 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , "Paul E . McKenney" , Ingo Molnar , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, kernel-team@android.com, Lai Jiangshan , Luc Van Oostenryck , Mathieu Desnoyers , Morten Rasmussen , Peter Zijlstra , rcu@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 4/4] sched: Annotate perf_domain pointer with __rcu Date: Wed, 20 Mar 2019 20:34:26 -0400 Message-Id: <20190321003426.160260-5-joel@joelfernandes.org> X-Mailer: git-send-email 2.21.0.225.g810b269d1ac-goog In-Reply-To: <20190321003426.160260-1-joel@joelfernandes.org> References: <20190321003426.160260-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP This fixes the following sparse errors in sched/fair.c: fair.c:6506:14: error: incompatible types in comparison expression fair.c:8642:21: error: incompatible types in comparison expression Using __rcu will also help sparse catch any future bugs. [From an RCU perspective] Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/sched/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 2b452d68ab2e..b52ed1ada0be 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -780,7 +780,7 @@ struct root_domain { * NULL-terminated list of performance domains intersecting with the * CPUs of the rd. Protected by RCU. */ - struct perf_domain *pd; + struct perf_domain __rcu *pd; }; extern struct root_domain def_root_domain;