Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp37963lqg; Fri, 26 Apr 2024 08:11:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYsLS+q732X+9s6Pcpf2TKc2iNQVCjwRhGfTdQDybX4jifksR7k1Ti6mdT8bkkHpGtcSVDs2LrhCCMia6pOfE/S+myECg7ya2xiIfjmQ== X-Google-Smtp-Source: AGHT+IHtH8VUMrvw9EpBqkSU3MTmF821Vaoku8NbNVsGiYagmvNzgVPO9appKwSs4HCE5AlnKj+3 X-Received: by 2002:a17:902:c404:b0:1ea:201:5843 with SMTP id k4-20020a170902c40400b001ea02015843mr3704150plk.6.1714144279735; Fri, 26 Apr 2024 08:11:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714144279; cv=pass; d=google.com; s=arc-20160816; b=q6qNdpxH3JOFYMuy2vEY/5Ki42lsoJu2flHLmR48gPtSt4ajLDoxkgBYIkfAndLOdA PCdlANWn8MxYnHb8Cbz3WCmuYBNCZZzDT3jbbw09xLweuAyc9ZTLL6Bj2Go0aAleQhh5 wikWFk27BB1SygsPBle+BdTyT2WfFXlxcH/2kSYePn6QvmXBw9s01kl7K38jLnno7ITK xHbcgaowGNcuJbb9HnR1TdX3RyP56IA5fowlkgQsS/WlmN57eOxmhYm3MfnfNjg6WgC9 zETd1CO1qMJmf6RjbMBZ+k4rq+zJ7idkFsLyJLG7AOMgttlW4vxmM8M0vVTO2/s1Kffj x8hw== 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=Qqdk8CS7W3K8yF80mnvZe0f2vnMh5BbYRCC4hk4BdRI=; fh=Vo4MxA0u7CmSKYL/GjcyKHwusyvU+nKR43bqJem+vcY=; b=EWc2ZBGf8+cc3Z3sJ6G51wl7Y5VuoKGac/4Tbpmz1T6YYCPkX9h6dNHCnbJ32U3crN qoFkXvomjj/4p8D3DyOOf5IPBOXjbmCeJO2yU7Wmfg6x2gREfGh+8OLRc43BHIoSNRYS KADn4bLDccSbYU5wCiksPSKbpQM3TxaxpA9Xyq365gV2HhjhvarTiZG0JKGGWIJUgJ48 oB8XMdKeIHu0OIvscQZSKU9POfumnukoeHZAZC7d1Z4jWuc+WQAuegAjM1VRLPJT+oTS yZ+F2gAlDz0uIFeAxEdgeOvqgsozaDi55+UVDaQHGU0YWCSLFQ/xuJgbMakeeHpJaljt TrPw==; 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-160222-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ix6-20020a170902f80600b001e3d3ae4d74si14881080plb.28.2024.04.26.08.11.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 08:11:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160222-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-160222-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160222-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 530592825E5 for ; Fri, 26 Apr 2024 15:10:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBB5815217A; Fri, 26 Apr 2024 15:09:32 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C995414F109 for ; Fri, 26 Apr 2024 15:09:30 +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=1714144172; cv=none; b=Zu7j11vFhn+mFuHy/QL2i0KwvJIBQ269c3lzMF5wb+hlhGT2fxEHyLbkqVFt/X2Y3Rxt3No7gKGVjfHXfMmtYyU7PRhl7IM1N351ZjWSItzQUScydcfzmX/DzKUEYMxlmWaJcPvQE4w3fXD9GYASM51S0MWKrvc33E4HXbyW/F0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714144172; c=relaxed/simple; bh=mQUMIAjQMLXinjyRmnPXcCSGpXSuxeEhQHIkgwgjvvs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fUHIDwSE2odk9QRG8w0rU9tFUVIdZQy2Vtsu2+/PMqyE4yjkJjLokek+z3QZnVlizCxXZR7XC30N225vmKeKsS3r7kX87FvQTx/F04pigOd3ayOrXk/RhOUpvLwpwL5GrO1Yh13GvkX6LBEsljOeoXfCOMvgKIUb9eQRRiv2+04= 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 75B58168F; Fri, 26 Apr 2024 08:09:58 -0700 (PDT) Received: from e133380.cambridge.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 91F8B3F73F; Fri, 26 Apr 2024 08:09:27 -0700 (PDT) From: Dave Martin To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: James Morse , Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, "Shaopeng Tan (Fujitsu)" , baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , Peter Newman , dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie Subject: [PATCH v2 06/35] x86/resctrl: Export resctrl fs's init function Date: Fri, 26 Apr 2024 16:08:35 +0100 Message-Id: <20240426150904.8854-6-Dave.Martin@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240426150904.8854-1-Dave.Martin@arm.com> References: <20240426150537.8094-1-Dave.Martin@arm.com> <20240426150904.8854-1-Dave.Martin@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 From: James Morse 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. Signed-off-by: James Morse Signed-off-by: Dave Martin --- Changes in v2: * 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 d07eff7d6750..b4e7d655e242 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -938,7 +938,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; @@ -963,7 +963,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; @@ -979,18 +979,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 9048bd32e86f..7c073298aabf 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -300,9 +300,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 06565153ceb2..9f2fafcf78f1 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -941,7 +941,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 871b59c2c886..997f31ee5de4 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -4118,14 +4118,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; @@ -4173,7 +4173,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 bf736ec22f71..de0297f6167a 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -336,4 +336,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.34.1