From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9DAAC433F5 for ; Thu, 16 Dec 2021 23:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HzKDVRVh3APDQuRrjdUCdBoAGRMj6b1KXK5TMI2R6jk=; b=yfLIqnQYtNeCpQ +Yxd71sW/U/1RB7IDVf2OPG8fpQapNcE8gUJeD29I1los43J/JKLcMjXfKXCVJskzQnu2Vu+wsaXn NyQzBvQNtgaMIf4ubrZ6fSyoO0xUPJlHX+wCFCkZHgkr0n4TsjmgYEeOXBBq7WPt5LWR9Vx2QYIR9 PlsWW+7rdYOAu+v1y+alj2eTmjfUhdJDDpirH2an87+jcHTm5TuXNco7cLf7iVGMj+81EWXy+tDsP YXB1F+oRY3W4thK0a9EmK0kIW9gike8WgdYrW8v1r7IitPoW3hIX5Cz95nDP26hSR8+4eNuT1rf4G ezTcfN+HGBH0Z7FxiF3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1my0EE-007wQI-H3; Thu, 16 Dec 2021 23:32:02 +0000 Received: from mail-ot1-f47.google.com ([209.85.210.47]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1my0Dk-007wHi-0r for linux-arm-kernel@lists.infradead.org; Thu, 16 Dec 2021 23:31:33 +0000 Received: by mail-ot1-f47.google.com with SMTP id h19-20020a9d3e53000000b0056547b797b2so787640otg.4 for ; Thu, 16 Dec 2021 15:31:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4o9kmT6MVqI4c+B16gX5bvAJwnYM06bebAI8lgZufvw=; b=kLo12nSy1qDXr9hcsQ+D9ycSJPJoTSTF5/hwqgIdrYN3h85C1MY8GsMrsVTIkSXLMG CZ4KdSQAW9SSmLcWrxHUwfwYdxN+DVwZbXBo9IzgabVBvcEp5eAmtaEYjgTz39SS23+e u7/135l1E/pvpndtibPU5WlOqlF16nljYVTIgzwE6Txm4N03YLc7cYmh0/IGGXNKz8hu yaEn9/BBkp2tEFddeCLO1/RzXmkpXkMiuLtOjG7fk0hffgdhZoQWgsGft0WANXI5g5d4 OYxrjDnk/Om89SRaL1rQkYZzamgGxhqj2mNgFqDsYSzRvVMz8RHzO1LtHDzLzCqa5un5 vF1g== X-Gm-Message-State: AOAM533GpdbFHWVShPbd0pORXqTFptldULTSEjyTKNzg5a7DM2n2N1yZ WCoiv+y8vBJL1yCpqXra8Q== X-Google-Smtp-Source: ABdhPJwJPckhRY71EAGczW5EOQ0K0FofxnZ4dWNjrtnwwnajnzwS1hMcl3WucPCL0Utsr711wG02+g== X-Received: by 2002:a9d:69ce:: with SMTP id v14mr335246oto.312.1639697491144; Thu, 16 Dec 2021 15:31:31 -0800 (PST) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id n11sm1256646oor.9.2021.12.16.15.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Dec 2021 15:31:30 -0800 (PST) From: Rob Herring To: Greg Kroah-Hartman , James Morse , Jeremy Linton Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , "Rafael J. Wysocki" , Len Brown , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH 3/6] cacheinfo: Add cpu_affinity_map to store affinity for all CPUs Date: Thu, 16 Dec 2021 17:31:22 -0600 Message-Id: <20211216233125.1130793-4-robh@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211216233125.1130793-1-robh@kernel.org> References: <20211216233125.1130793-1-robh@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211216_153132_117183_2BCFBC31 X-CRM114-Status: GOOD ( 14.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently, getting the cache CPU affinity for all possible CPUs requires walking the DT or ACPI tables. As that is already done once (for each CPU online event), let's save the affinity for possible CPUs so it can be retrieved later. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Rob Herring --- drivers/base/cacheinfo.c | 1 + include/linux/cacheinfo.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index 21accddf8f5f..c9e5b48fac42 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -149,6 +149,7 @@ static void cache_of_set_id(struct cacheinfo *this_leaf, struct device_node *np) id = of_get_cpu_hwid(cpu_node, 0); while ((cache_node = of_find_next_cache_node(cache_node))) { if (cache_node == np) { + cpumask_set_cpu(cpu, &this_leaf->cpu_affinity_map); if (id < min_id) { min_id = id; of_node_put(cache_node); diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h index b2e7f3e40204..37652cfdd8dc 100644 --- a/include/linux/cacheinfo.h +++ b/include/linux/cacheinfo.h @@ -56,7 +56,8 @@ struct cacheinfo { unsigned int ways_of_associativity; unsigned int physical_line_partition; unsigned int size; - cpumask_t shared_cpu_map; + cpumask_t cpu_affinity_map; /* possible CPUs */ + cpumask_t shared_cpu_map; /* online CPUs */ unsigned int attributes; #define CACHE_WRITE_THROUGH BIT(0) #define CACHE_WRITE_BACK BIT(1) -- 2.32.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel