Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp882603lqs; Fri, 14 Jun 2024 08:16:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVCCajy5U2aBvmjamH0YFD/dO1l9L2hQ5WQXEqy6CmVo5ANIjpD4d3j2cO9Av5UqJlEk3+Z8VI+atuKr8PoAQ9225AChzx0EKfekLnKg== X-Google-Smtp-Source: AGHT+IEf6hX4Mu1TScQLtLw1DsISKwrUXZszgyVz/MfQtPUPYAlXuTSOubhkBk2HmQhXNNniM00r X-Received: by 2002:a17:902:ec8a:b0:1f6:fcd9:5b86 with SMTP id d9443c01a7336-1f8625c35a8mr36978575ad.12.1718378193782; Fri, 14 Jun 2024 08:16:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718378193; cv=pass; d=google.com; s=arc-20160816; b=Ag5ynZ7ZJNCcFSaItZykspS7A4zK5fiOyKStDDVDGnjt8PHxVeosW4F2CukF2hRNj5 HvDyh7wh/ERQj3CGmVPG/KRRaUgGUYdmZlkb0937JCFSNA6nkAhYdQwucAjPrCnpYnr3 DHQNk0t/iHqAQ/REb5RiwPBq6VkUD/3MUk4l+NjdFnvS43bxcxDgbO6yJ3f7Z+scNbOB 6LJwVFmi8vb2qCXQLoFGl25KPaMJDMigM6EJCrylZ2cKTWd38ICId6qcRzf4ug0MsIUy nPavqr3K0y3v02aRxAASeTUyDk6I0v80lhNqZ+4rqn7I9s7RvYP0zKiiSXCiUlThgkiZ HUOg== 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=Q5QQbvWAjrZysDNbTdztjISPmMIn/gB0UMfZNSpH41A=; fh=knouHfhWmUABu+sT2q0nnGKUzC7/WRiZH1KSpGv7uFs=; b=wO+SqQ/TIsp+jjN1kTYI6dJtMVSN/39tYmepl2VWChQ9TOSaeJatKU7fZnlf8Rv4aX xHDLgvG81fBswK4xPFKfHLxUGf/dMBTP6px8911QcQtHrQhYO8ObDDb/L2pmALul+GHX p+aA6uB0CsPSUDpE2HFcS9LgtkA3+ME13WM/dNjqj+ib/HGjXVceGSMR3b7wr2s2ZwWL 3d5B1auWHwTGZYQryvwl7ecKhldIzC6RxXwP/q5QpmzeTrobF4QCTdjjmcoXMA0MpGsC MPMqPp/pAxAltrst5KIpG3PMbpkY2bxujzT76cjaJ/HSLf2okhQ6qMkdlZPPJ6vdIRfg /usQ==; 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-215101-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215101-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 d9443c01a7336-1f86e1d835esi7945655ad.457.2024.06.14.08.16.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 08:16:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215101-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-215101-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215101-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 1F84228BD39 for ; Fri, 14 Jun 2024 15:08:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9D2F1AED21; Fri, 14 Jun 2024 15:03:01 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE0271AD9FF for ; Fri, 14 Jun 2024 15:02:59 +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=1718377381; cv=none; b=kqj9bJbm0PazFV6Pm6t6AQPInkUobbbllKj4j5RtESCQ0E+MIObfYBy0pljbz6YBFZr0jQeUNE7Fm4hsj98iEzRxuFrG57kJXrav44geWMR3KOGf3Ow740jmp+2lbfPcugfHi0q9HeqWqKeOdAYeWISeJIb/sAt7qxnEoghW6vE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377381; c=relaxed/simple; bh=/nxzx6XM4ztv30myhh5qXB7yzV0eEKB/Q0ERFzhYLDo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MZpl93ZpH6T4Sfk/1MiX+ve5CPYEpa6zGi5GfqPzSXkiuBhynAku5V+SoxBYaBImYIWJEl2Mj622WKOeJTMagRkTpunrcbSpe3mILhlTGUbh+IshiKSCqMzOjrwzihMZhclG5f3A0Liipvp5HXqpT7h4YsJAIuQzUHbjFCghmIk= 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 DEBF81BF7; Fri, 14 Jun 2024 08:03:23 -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 52A333F5A1; Fri, 14 Jun 2024 08:02:56 -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 v3 33/38] x86/resctrl: Move is_mba_sc() out of core.c Date: Fri, 14 Jun 2024 15:00:28 +0000 Message-Id: <20240614150033.10454-34-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 is_mba_sc() is defined in core.c, but has no callers there. It does not access any architecture private structures. Move this to rdtgroup.c where the majority of callers are. This makes the move of the filesystem code to /fs/ cleaner. Signed-off-by: James Morse --- Changes since v2: * This patch is new. --- arch/x86/kernel/cpu/resctrl/core.c | 15 --------------- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 258e0a945f87..cb8119d58c30 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -160,21 +160,6 @@ static inline void cache_alloc_hsw_probe(void) rdt_alloc_capable = true; } -bool is_mba_sc(struct rdt_resource *r) -{ - if (!r) - r = resctrl_arch_get_resource(RDT_RESOURCE_MBA); - - /* - * The software controller support is only applicable to MBA resource. - * Make sure to check for resource type. - */ - if (r->rid != RDT_RESOURCE_MBA) - return false; - - return r->membw.mba_sc; -} - /* * rdt_get_mb_table() - get a mapping of bandwidth(b/w) percentage values * exposed to user interface and the h/w understandable delay values. diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 0936a4cddc9e..f13b5b0404e4 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1500,6 +1500,21 @@ unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r, return size; } +bool is_mba_sc(struct rdt_resource *r) +{ + if (!r) + r = resctrl_arch_get_resource(RDT_RESOURCE_MBA); + + /* + * The software controller support is only applicable to MBA resource. + * Make sure to check for resource type. + */ + if (r->rid != RDT_RESOURCE_MBA) + return false; + + return r->membw.mba_sc; +} + /* * rdtgroup_size_show - Display size in bytes of allocated regions * -- 2.39.2