Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1683447ybi; Wed, 17 Jul 2019 20:04:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0uDUYzv4rHctbTT8iEScuyyW42JYd+cUfldpTaxkjn9mj2PIuxI6l15sZX3PCsJ8JKj3i X-Received: by 2002:a65:6104:: with SMTP id z4mr8816475pgu.27.1563419074705; Wed, 17 Jul 2019 20:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563419074; cv=none; d=google.com; s=arc-20160816; b=ZT5xgleje8CAhJto/7hASVa5pHEP+LjHCorYvBAMC3qjXLBWPms+pBB8LRbyjIcY+1 qb1ygi17TyhrcU47Q9ZeGwoXco8gjL7B8xqYspxcmvbvnLb0nwz8Ry1hc5r4qBQrOTZ/ tu52JwcX/y+HDQ3UzLK2di79rBfbSRVUkLdGEVBPmfsafjtRG4Qw+bVaO2pNX/ubyv/e Rwu4zNnojeAGnkGOVq/aJJYH6Ck7os/9nR/zdEpV3XvUQhCz34FvL2a0qeGCx1Ng6G9A wcVG5Vzrc2e3sepusC3t+84VrPN2rZ8BJu/Gn9muT1VMThjkRs1jeP4FYZ4k/8C8PmVC 6a3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mIG2aGOGkkMgiGceqapZeh61wGoDWCFDsalwvuvJ/zM=; b=h1Um9gMHBRitkyQTLyC+Q3FniTWVYPZJ0pWlrHb3fi1OVmnaJf9x14ZRe+JHySfBKb ekyQxyhUX3f7L5gYgKmW+Wo7U2WoZRcR+OGv8l+fsttziZVH9Agq1q0b1EapRuFFI7iV prhSBWYBSnG7D9myA5X6kwU4/qfYjnArrzFia249cqZA/EQ/bGFq+KTFapOIEW+2zOHN SKYkxbaYpIIQARTSW+ApWgm4PDGSJiPWwQ2r/hRxlufF7M84wWM2PZDe8ASgigHNS1IY HQKfMVRSH+nTc6EWXMLbmrDsFhzhmmbX1NfyKKDTRf90nbodC24QqcYqYS1AFtiVEdxp +ong== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="aZx7/l7c"; 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 e66si24885253plb.254.2019.07.17.20.04.18; Wed, 17 Jul 2019 20:04:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b="aZx7/l7c"; 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 S2389316AbfGRDD0 (ORCPT + 99 others); Wed, 17 Jul 2019 23:03:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:34050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389252AbfGRDDY (ORCPT ); Wed, 17 Jul 2019 23:03:24 -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 5BF692173B; Thu, 18 Jul 2019 03:03:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419004; bh=PG3T8mXmGSKOIY8ZLT45pOA+wxybHzy/qkPK3tpEaWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aZx7/l7cmmOOivGKNWf6vMzb+kMnPU5DpRGjL/XOIjKbt/2txuHlwfimCxuqRObyI aKoIqZusVSpuu1TvChQgLSBZDEyYAIPHlaDG5bdPAJfrusfHdPVrP2k5tuulcQhQLI JF/MU3+hNY28eUX4R/iagsurUFzmmffQgSIQ2PJA= 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 5.2 05/21] drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT Date: Thu, 18 Jul 2019 12:01:23 +0900 Message-Id: <20190718030031.591880791@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718030030.456918453@linuxfoundation.org> References: <20190718030030.456918453@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -655,7 +655,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 @@ -176,6 +176,7 @@ enum cpuhp_state { CPUHP_AP_WATCHDOG_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,