Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp568217rdb; Mon, 15 Jan 2024 06:35:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGV2GtVUGtpk8hkl0KOOZw3PX4N2lj/iuSWWMre/vRqmQ9FB8FFtqbCx8aV5zaq5lVAp0wh X-Received: by 2002:a17:906:bcd8:b0:a28:e7f2:43bb with SMTP id lw24-20020a170906bcd800b00a28e7f243bbmr2249226ejb.53.1705329301471; Mon, 15 Jan 2024 06:35:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705329301; cv=none; d=google.com; s=arc-20160816; b=tBRd6iydNJQj1B4rbqlc8OsvDMhIS0GJPvdXQW/ED0Q+gkb5Vps29zYou0HgnRD46R pgfCh4IQUOXW8ERjOtqbBwVcH1GyyHBy1BrAbd3I73F242Ke6V+UwBg2YVxV4lWksOsF svGQvvBjlexPDVng/NXypOrvOGNqxSSl9dXn4j/Qrejix0/SHhV5HiSo96EoTqL35FNJ hoOQ8yjrAPFcZ63L81iiD+EtvIzkY7pr1IaWlRriMyk071nFDwBmxJOIWsQNzSX8F+sU ybVbs2KSaQ+BBRBajPjwTQtBLpZVfZvawvriO4/SvedBFzNsXX06MjZyE86GDoEkMrN1 SFYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Cw4WdXsJbbE3lP7Y3UEXgmv5z6n/1LcrXaau+tFBo+M=; fh=ceGY8gx3ag7g2dEDXECiNTMxyZp1SjBjuBUw72Wx2IM=; b=iS1H1T49eagnK6/RDg5UdC1r70ltzjUmH7HjTA4UFv3kgombl5/eEdAYIiaCXx6SY4 FGVh9BvX/FMteI3alVyXQhOvZViW9V90EzI3SXM1kALrgfiKC6OKT/xGD2ybUqK1dsG5 mJofbdQlaKXwlHmdgHV9Kn6o88FbwbIgWiVp5Mcim5ZQLmkb7CTLcYcQnFlWe2IMd4tX BKKEP3o+kiQ9bpBpxflvP7/+6E0KZW9+a1tXroTUXR/O0jU8fKNWNRHl1gYvjPUCxNLV 284e9MyD7T2dmj1Qrm7UeOp3jPHXQCKyZFQwOO2JQcR39tw2DiMkDBuKrREr3eh4c9Bp PEGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c24-20020a170906171800b00a2cebb4ad80si2667137eje.322.2024.01.15.06.35.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 06:35:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26091-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1E90C1F22604 for ; Mon, 15 Jan 2024 14:35:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF85517740; Mon, 15 Jan 2024 14:34:42 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 977FF17F3 for ; Mon, 15 Jan 2024 14:34:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8ADF8FEC; Mon, 15 Jan 2024 06:35:26 -0800 (PST) Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 13F2E3F6C4; Mon, 15 Jan 2024 06:34:37 -0800 (PST) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Shrikanth Hegde , Pierre Gondois , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Huang Ying Subject: [PATCH v2 1/3] sched/topology: Annotate RCU pointers properly Date: Mon, 15 Jan 2024 15:34:24 +0100 Message-Id: <20240115143427.1820628-2-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240115143427.1820628-1-pierre.gondois@arm.com> References: <20240115143427.1820628-1-pierre.gondois@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cleanup RCU-related spare errors by annotating RCU pointers. sched_domains_numa_distance: error: incompatible types in comparison expression (different address spaces): int [noderef] __rcu * int * sched_domains_numa_masks: error: incompatible types in comparison expression (different address spaces): struct cpumask **[noderef] __rcu * struct cpumask *** The cast to (void *) adds the following sparse warning: warning: cast removes address space '__rcu' of expression but this should be normal. Fixes: 0fb3978b0aac ("sched/numa: Fix NUMA topology for systems with CPU-less nodes") Signed-off-by: Pierre Gondois --- kernel/sched/topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 10d1391e7416..2a2da9b33e31 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1542,8 +1542,8 @@ static int sched_domains_numa_levels; static int sched_domains_curr_level; int sched_max_numa_distance; -static int *sched_domains_numa_distance; -static struct cpumask ***sched_domains_numa_masks; +static int __rcu *sched_domains_numa_distance; +static struct cpumask ** __rcu *sched_domains_numa_masks; #endif /* @@ -1988,8 +1988,8 @@ void sched_init_numa(int offline_node) static void sched_reset_numa(void) { - int nr_levels, *distances; - struct cpumask ***masks; + int nr_levels, __rcu *distances; + struct cpumask ** __rcu *masks; nr_levels = sched_domains_numa_levels; sched_domains_numa_levels = 0; @@ -2003,7 +2003,7 @@ static void sched_reset_numa(void) int i, j; synchronize_rcu(); - kfree(distances); + kfree((void *)distances); for (i = 0; i < nr_levels && masks; i++) { if (!masks[i]) continue; @@ -2011,7 +2011,7 @@ static void sched_reset_numa(void) kfree(masks[i][j]); kfree(masks[i]); } - kfree(masks); + kfree((void *)masks); } if (sched_domain_topology_saved) { kfree(sched_domain_topology); -- 2.25.1