Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp889055lqs; Fri, 14 Jun 2024 08:26:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXP2FqTTx3Urov+XRU1imq2ka5B1QRAwD0eIxro+nLcodNUtZd1HSVl9tEmIqCgbMDFOS+icnRjmLyzzK3+E0BRqjyihmobrA7UQqW2g== X-Google-Smtp-Source: AGHT+IFd0awkviaR6jjc5OfGWLRxijiqkppbpLUCKJn+YDloE3gW/oklP63Or2dSa4pw4B8L8b8W X-Received: by 2002:a17:90a:e38f:b0:2c2:e32b:80f6 with SMTP id 98e67ed59e1d1-2c4dbd38f83mr2781935a91.44.1718378806412; Fri, 14 Jun 2024 08:26:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718378806; cv=pass; d=google.com; s=arc-20160816; b=Ry4rbCS4BtdyGVPZQiYHV3MJUjCwLsFiWzCW/dKB54DQC5GPJaqQiciAhrN49tg2y2 RV3wr4oj/sWLTtm+ZbimlrkMjUoEbESY4YGTbLb8ytTu54TIHlrD2vv/HbWJez1/2YIr gxvvrcM+sa2OVVTnL6dcS7/bJ3hMZsYL+6/Z3Dj8o/8SWvCy4yBUpSzHvyAymvfRp/vk g6dycASwoE2QnS3ThOIsuPn1ZnybZlSXc/t96WffKjP3nCiDk3iPVhB7K7HwejdggUaA 8WAWOIa3Jzwrzfy1ZeJVVBMsG+/coFax8DDqdpn6qJGt5zGXNpf/BErYRbNu5P2iA+7H ipaA== ARC-Message-Signature: i=2; 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=o1b/XRn8FptARBPhlG3I83dhd3z1+sylwWGH3XZmAbQ=; fh=AQRRtkmHyvZI0LQ5UvExX7X5tmBE1F1lr2MH+s0Lwao=; b=BMbgyai3u1wmIesaAUisxbtUEwwU5X+UVv5hySDOWTiAX3zX54MdFp5tpd1/nQBWLj TvGU6lkjPbhUPthd8MMCjR7KoOvp3vPgDKTZDrNYa+QjU44YHzRp5S91zuX4DDW8j1lm K4YUjWUPBCuwff9k1ByfntrkWgKz6z6Z7Rt3W+/TQneAqeeHGgxsTpYaZbfBIkd6INpL VHieLJZY3Yrnvx5fFqKv+7bSg/5ZQBdjelQhTtQMkIBxJLoqiRZ2r41oGOHFw6EtwGwD slpHMO1328wjQE7hkFBTj0RB/lbV1BqtHCSD+FkN+kttZuWJqOrsx0l38iq8LamQ9ZR9 aYoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-215077-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215077-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4a76abd2csi5990047a91.111.2024.06.14.08.26.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 08:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215077-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-215077-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215077-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C4A41B253BB for ; Fri, 14 Jun 2024 15:03:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04F5019AA7E; Fri, 14 Jun 2024 15:01:48 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB3761922F8 for ; Fri, 14 Jun 2024 15:01:45 +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=1718377307; cv=none; b=mIK/pbMybybjHIpIY0yrIDrc43bHMDVVp5kEDxK5st3G1k6Od5If69FnEa0GDaCRGkJwHT0upCbsbAi9Ee3CvNNwrxiA8twRFDigBJlQav53WDW8VqKs8C+cbWmUoy0tbZR/jdXiVhjY2VtfeOJCMisVJO56NQjwbLupd8Ndi+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377307; c=relaxed/simple; bh=DLu4Vxo8H5vC7PnrihE2f7kS6Vqljz6KdpOkQpQ9ukA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XaVElX3UsElOpQjF0ghgxlbapVd+bPtMtym126MpKr6KELYZQ/dtjQGXP7G5Xp/kcC8Lkq+9ixu67v20Pg0nWBkHzUCFP1y3qMfPkg2r7BtqBaVhNijND5tuyOip8H5uSS8DXanN4uyo6ARtZCxa69hZv7XEvfHqT7srAnTq8us= 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 D3A9E175A; Fri, 14 Jun 2024 08:02:09 -0700 (PDT) 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 0FD3A3F5A1; Fri, 14 Jun 2024 08:01:41 -0700 (PDT) From: James Morse To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , 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 , Dave Martin , Shaopeng Tan Subject: [PATCH v3 11/38] x86/resctrl: Export resctrl fs's init function Date: Fri, 14 Jun 2024 15:00:06 +0000 Message-Id: <20240614150033.10454-12-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240614150033.10454-1-james.morse@arm.com> References: <20240614150033.10454-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: 8bit rdtgroup_init() needs exporting so that arch code can call it once it lives in core code. As this is one of the few functions exported, rename it to have "resctrl" in the name. The same goes for the exit call. x86's arch code init functions for RDT are renamed to have an arch prefix to make it clear these are part of the architecture code. Co-developed-by: Dave Martin Signed-off-by: Dave Martin Signed-off-by: James Morse Tested-by: Peter Newman Tested-by: Shaopeng Tan Reviewed-by: Shaopeng Tan --- Changes since v1: * Rename stale rdtgroup_init() to resctrl_init() in arch/x86/kernel/cpu/resctrl/monitor.c comments. No functional change. * [Commit message only] Minor rewording to avoid "impersonating code". * [Commit message only] Typo fix: s/to have the resctrl/to have resctrl/ in commit message. --- arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++------ arch/x86/kernel/cpu/resctrl/internal.h | 3 --- arch/x86/kernel/cpu/resctrl/monitor.c | 2 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 8 ++++---- include/linux/resctrl.h | 3 +++ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 9241f3ff3870..fe7b99e7f07e 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -902,7 +902,7 @@ void resctrl_cpu_detect(struct cpuinfo_x86 *c) } } -static int __init resctrl_late_init(void) +static int __init resctrl_arch_late_init(void) { struct rdt_resource *r; int state, ret; @@ -925,7 +925,7 @@ static int __init resctrl_late_init(void) if (state < 0) return state; - ret = rdtgroup_init(); + ret = resctrl_init(); if (ret) { cpuhp_remove_state(state); return ret; @@ -941,18 +941,18 @@ static int __init resctrl_late_init(void) return 0; } -late_initcall(resctrl_late_init); +late_initcall(resctrl_arch_late_init); -static void __exit resctrl_exit(void) +static void __exit resctrl_arch_exit(void) { struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl; cpuhp_remove_state(rdt_online); - rdtgroup_exit(); + resctrl_exit(); if (r->mon_capable) rdt_put_mon_l3_config(); } -__exitcall(resctrl_exit); +__exitcall(resctrl_arch_exit); diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 7e0b0b5f3530..73b44b684c52 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -301,9 +301,6 @@ extern struct list_head rdt_all_groups; extern int max_name_width, max_data_width; -int __init rdtgroup_init(void); -void __exit rdtgroup_exit(void); - /** * struct rftype - describe each file in the resctrl file system * @name: File name diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c index 96aaaa87c82c..3e5375c365e6 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -952,7 +952,7 @@ static int dom_data_init(struct rdt_resource *r) /* * RESCTRL_RESERVED_CLOSID and RESCTRL_RESERVED_RMID are special and * are always allocated. These are used for the rdtgroup_default - * control group, which will be setup later in rdtgroup_init(). + * control group, which will be setup later in resctrl_init(). */ idx = resctrl_arch_rmid_idx_encode(RESCTRL_RESERVED_CLOSID, RESCTRL_RESERVED_RMID); diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 9143cc0d384e..1574f5afd0e8 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -4146,14 +4146,14 @@ void resctrl_offline_cpu(unsigned int cpu) } /* - * rdtgroup_init - rdtgroup initialization + * resctrl_init - resctrl filesystem initialization * * Setup resctrl file system including set up root, create mount point, - * register rdtgroup filesystem, and initialize files under root directory. + * register resctrl filesystem, and initialize files under root directory. * * Return: 0 on success or -errno */ -int __init rdtgroup_init(void) +int __init resctrl_init(void) { int ret = 0; @@ -4201,7 +4201,7 @@ int __init rdtgroup_init(void) return ret; } -void __exit rdtgroup_exit(void) +void __exit resctrl_exit(void) { debugfs_remove_recursive(debugfs_resctrl); unregister_filesystem(&rdt_fs_type); diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 03024681920b..476d92ab0884 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -369,4 +369,7 @@ void resctrl_arch_reset_rmid_all(struct rdt_resource *r, struct rdt_domain *d); extern unsigned int resctrl_rmid_realloc_threshold; extern unsigned int resctrl_rmid_realloc_limit; +int __init resctrl_init(void); +void __exit resctrl_exit(void); + #endif /* _RESCTRL_H */ -- 2.39.2