Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp603311lqp; Thu, 21 Mar 2024 10:00:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUCLZ/VRdahfC+wVVHgk9xsFrpc8RrFCbFX41qVpOwqRo8X5Mwq7dJScAtH7Qu7c2KbP+6GhdHCQpq8llIT0yjyrU4DZ2oTNLEKonG0BQ== X-Google-Smtp-Source: AGHT+IFSaMhgqbO069gRz2LHbDFPzHmYw6UEXdO8zRqdLsiT6LxxeuQi2DoXK1LIanpnYGRrTutF X-Received: by 2002:a05:6a20:650f:b0:1a3:673b:62b8 with SMTP id n15-20020a056a20650f00b001a3673b62b8mr87758pzg.35.1711040420547; Thu, 21 Mar 2024 10:00:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711040420; cv=pass; d=google.com; s=arc-20160816; b=bxgJ+BW3bHeDs6bjagdCKBNTtuK6yFi5QgMcK9FLtTq6dHvfR6HCnxiekqd3AYTERj Qew7Q/GQRDqStRmRGDHkeuYHpU+mFmZhZnrXA5xYIz3bxCpWNYAeUMc4EUyDW9ep9jtO ljfmAD+6hbmuh2Ik6PNqR6+VC54EEsSZttstl97IdqIf+ds9FQceYXhYA+9AXVSiFpra u90i/358Aw8X1xy25XzfXVjqpRvj2I1BVIaCp6svZAFvDNO59+OS+Cybqk3wDqlyccqr FpJrVAJmAAvNnipCmxK4O8hkllPYO4Br06SOyGzRv7k8ZGLGKX6X2rrsBbqbgw74/0mY 1t/w== 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=vw11kUEkhs/kE+3QKfY1MporZpdg4UrS9Hpk8ivGyaM=; fh=knouHfhWmUABu+sT2q0nnGKUzC7/WRiZH1KSpGv7uFs=; b=gjS95qLMC9yeIbPaDb6Ekj92/lwvCj7/B0MYSXHj5R2vPl7BZrdIRaQW6AJcUE7B9U orhZj/EARcxjQpk5AQDK2t2RQIMQPLYjmzjjcAEKvaiaL7wsUySJ+x8gkkUzOhRTWb/9 KqL0llnmidjjfvYmONqFugquGPyiQJ0gAVfoH2CBUkClmlao5AAxgPiVPqQaN/2MSY6w E7XPGVhkhl+bxl1MYRqN1UgJMh7Wm8kgFUbVZ4iktuIVwa9RX8XlnZA4W7i6rtGZB+aS u+GTvhk7vCrkGW4xGn97ZlNNhPrlucW29apdD1mT1iD8/hc1HhdT0mDYi8jEuACxXSpT fb7A==; 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-110422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110422-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id hq11-20020a056a00680b00b006e7361a95e8si93139pfb.66.2024.03.21.10.00.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 10:00:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-110422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110422-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 A3E522856CE for ; Thu, 21 Mar 2024 16:59:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E41813958A; Thu, 21 Mar 2024 16:51:51 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A358139579 for ; Thu, 21 Mar 2024 16:51:49 +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=1711039911; cv=none; b=qxwmX5+MCYIZ8rGcLZbunTbS84ommJ9mNMjo9fr8hd2AYmiyOkjxCENFXirETGB2qnNy+Ws5amyj6xCTqGDtie//MkwgbHnyFQ8dEipyk1qMYZn2Opt0xTgX+BUyiBpoJ2PmAv1npvxOLWE6mgRS0g9vnog4NyMeA4kkoAcQPkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711039911; c=relaxed/simple; bh=5w+JNJyOYRaWpWJB2SC1m6D4Ky4uBiczPuWcI4IQlyc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=twmwqEVRJwRlQlwGj5U0Vfi3ZLl6mYeZqAU2L0RE3MGFHakszSGjVi5F6l2MyHaACr9hSaUBg8Idf6Z17VKgUl6ImmXoj044yyDi8b52J5cji/mRGU2DfIAQR4OV2LNszi3T9EdkJ8isCarhvxcwvZiV/UNJCLTXaPw/qqKvPL8= 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 373E41007; Thu, 21 Mar 2024 09:52:23 -0700 (PDT) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ED3D03F67D; Thu, 21 Mar 2024 09:51:45 -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 Subject: [PATCH v1 06/31] x86/resctrl: Export resctrl fs's init function Date: Thu, 21 Mar 2024 16:50:41 +0000 Message-Id: <20240321165106.31602-7-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240321165106.31602-1-james.morse@arm.com> References: <20240321165106.31602-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 we export, rename it to have the 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 --- arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++------ arch/x86/kernel/cpu/resctrl/internal.h | 3 --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 8 ++++---- include/linux/resctrl.h | 3 +++ 4 files changed, 13 insertions(+), 13 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/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 18f097fce51e..1a49c9918f8d 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -4116,14 +4116,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; @@ -4171,7 +4171,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 2b79e4159507..f6a4b75f8122 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -325,4 +325,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