From nobody Mon Feb 9 12:23:57 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9E8027A242 for ; Fri, 28 Feb 2025 20:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740772877; cv=none; b=Kv4W+WyFnNPmPbhcH/SPwJvc/7epxZLipOFlCcZSITDb/IVqOQiHbsbzfJBC1PrktMNKHOMFVGrjfg3J31AT/++dGmSUstd6xzGxeoNHMbLUg71zpYNkGVmg9r8nMIIpQEH7Q0emS6hvdeLRVVQq+0hH33dg+T/BHR/4fcfx9ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740772877; c=relaxed/simple; bh=XV8GbrYhWEoeIG+MGgdMn1SF9ftL2PaJc6LmxfsQ350=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LMJSF5OeG4pAZDHL6r94qpcWrvLsj6cW60YhZI7vStdqzZ+Z/pJ494R3AdJ+TpsDSW7EDY+hrFe4AiKFNDQY6T7ewbGnDVesrygY7cByEM7sqm92eFSlhXfbYO5pKzlw6NcQxFFG/DzDvZZxLWoBCQTNvo5mT1JNaKoHjY3PRN4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 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 64D8919F0; Fri, 28 Feb 2025 12:01:30 -0800 (PST) Received: from merodach.members.linode.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 22F333F5A1; Fri, 28 Feb 2025 12:01:12 -0800 (PST) From: James Morse To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , James Morse , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie , Dave Martin , Koba Ko , Shanker Donthineni , fenghuay@nvidia.com Subject: [PATCH v7 21/49] x86/resctrl: Move mba_mbps_default_event init to filesystem code Date: Fri, 28 Feb 2025 19:58:45 +0000 Message-Id: <20250228195913.24895-22-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20250228195913.24895-1-james.morse@arm.com> References: <20250228195913.24895-1-james.morse@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: quoted-printable Content-Type: text/plain; charset="utf-8" mba_mbps_default_event is initialised base on whether mbm_local or mbm_total is supported. In the case of both, it is initialised to mbm_local. mba_mbps_default_event is initialised in core.c's get_rdt_mon_resources(), while all the readers are in rdtgroup.c. After this code is split into architecture specific and filesystem code, get_rdt_mon_resources() remains part of the architecture code, which would mean mba_mbps_default_event has to be exposed by the filesystem code. Move the initialisation to the filesystem's resctrl_mon_resource_init() Signed-off-by: James Morse Reviewed-by: Reinette Chatre Reviewed-by: Fenghua Yu --- arch/x86/kernel/cpu/resctrl/core.c | 5 ----- arch/x86/kernel/cpu/resctrl/monitor.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 943e4c56077b..2c352938d18d 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -925,11 +925,6 @@ static __init bool get_rdt_mon_resources(void) if (!rdt_mon_features) return false; =20 - if (resctrl_arch_is_mbm_local_enabled()) - mba_mbps_default_event =3D QOS_L3_MBM_LOCAL_EVENT_ID; - else if (resctrl_arch_is_mbm_total_enabled()) - mba_mbps_default_event =3D QOS_L3_MBM_TOTAL_EVENT_ID; - return !rdt_get_mon_l3_config(r); } =20 diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/re= sctrl/monitor.c index 27d983121b0a..306b06ba32db 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -1213,6 +1213,11 @@ int __init resctrl_mon_resource_init(void) RFTYPE_MON_INFO | RFTYPE_RES_CACHE); } =20 + if (resctrl_arch_is_mbm_local_enabled()) + mba_mbps_default_event =3D QOS_L3_MBM_LOCAL_EVENT_ID; + else if (resctrl_arch_is_mbm_total_enabled()) + mba_mbps_default_event =3D QOS_L3_MBM_TOTAL_EVENT_ID; + return 0; } =20 --=20 2.39.5