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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BCA6C76195 for ; Thu, 18 Jul 2019 03:22:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73AE321783 for ; Thu, 18 Jul 2019 03:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563420145; bh=BaZmS89+7veFzdtMUV+Ad7wsnwkamaLGooESqiAaTkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=byvWt4lmGixxANp7FZkltJlU9cTzKBLsQ1lHXosvlFIcHMvsgjtrhgAZdnwBBhTL5 2WCpYZUt3KYmwMDJ2KIuwfTYwymKTscT/XGOZllXk893Gp5Tywgnq2X572FvVPVxxh jkDq7/zNHvdOcl9vs0tmOyCpm+QYQ5hQ0tHgbmiM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390894AbfGRDIy (ORCPT ); Wed, 17 Jul 2019 23:08:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:41150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390891AbfGRDIy (ORCPT ); Wed, 17 Jul 2019 23:08:54 -0400 Received: from localhost (115.42.148.210.bf.2iij.net [210.148.42.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 904E621850; Thu, 18 Jul 2019 03:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419332; bh=BaZmS89+7veFzdtMUV+Ad7wsnwkamaLGooESqiAaTkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eoaEA4SryY+hYA5tMlndhFDfUvkxNKT3rb4LpqyYNYdN3K0Cz3dALZvDWPQ/2YPeg 0+rWf9m193ys/ly/FTz1a4XetWNqngCcHJrduQfGbtBFBBX4SZLkqopeehn4dJd9We NAXY0tgJtb+uhk889b84bImXSifst4Vxr5Lw+pj4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fenghua Yu , Reinette Chatre , James Morse Subject: [PATCH 4.14 05/80] drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT Date: Thu, 18 Jul 2019 12:00:56 +0900 Message-Id: <20190718030059.272174890@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718030058.615992480@linuxfoundation.org> References: <20190718030058.615992480@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: James Morse commit 83b44fe343b5abfcb1b2261289bd0cfcfcfd60a8 upstream. The cacheinfo structures are alloced/freed by cpu online/offline callbacks. Originally these were only used by sysfs to expose the cache topology to user space. Without any in-kernel dependencies CPUHP_AP_ONLINE_DYN was an appropriate choice. resctrl has started using these structures to identify CPUs that share a cache. It updates its 'domain' structures from cpu online/offline callbacks. These depend on the cacheinfo structures (resctrl_online_cpu()->domain_add_cpu()->get_cache_id()-> get_cpu_cacheinfo()). These also run as CPUHP_AP_ONLINE_DYN. Now that there is an in-kernel dependency, move the cacheinfo work earlier so we know its done before resctrl's CPUHP_AP_ONLINE_DYN work runs. Fixes: 2264d9c74dda1 ("x86/intel_rdt: Build structures for each resource based on cache topology") Cc: Cc: Fenghua Yu Cc: Reinette Chatre Signed-off-by: James Morse Link: https://lore.kernel.org/r/20190624173656.202407-1-james.morse@arm.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/cacheinfo.c | 3 ++- include/linux/cpuhotplug.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -669,7 +669,8 @@ static int cacheinfo_cpu_pre_down(unsign static int __init cacheinfo_sysfs_init(void) { - return cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "base/cacheinfo:online", + return cpuhp_setup_state(CPUHP_AP_BASE_CACHEINFO_ONLINE, + "base/cacheinfo:online", cacheinfo_cpu_online, cacheinfo_cpu_pre_down); } device_initcall(cacheinfo_sysfs_init); --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -163,6 +163,7 @@ enum cpuhp_state { CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE, CPUHP_AP_WORKQUEUE_ONLINE, CPUHP_AP_RCUTREE_ONLINE, + CPUHP_AP_BASE_CACHEINFO_ONLINE, CPUHP_AP_ONLINE_DYN, CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30, CPUHP_AP_X86_HPET_ONLINE,