From patchwork Tue Aug 15 15:27:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Singh Tomar X-Patchwork-Id: 13353923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE216C001B0 for ; Tue, 15 Aug 2023 15:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I1Iyo30Z9a1j60kG/OabwDx8NCL/jVZfyNRT57+G43k=; b=ezpV6ITb21j6MU gSITDed7SRFxdOkzkHryiwHD6B/agskli8aR0+2vAeERN3IkgQWNawZa8CbRkoVw4nCbBH+RAzYRi 1RzwOEmzstS/x871663QOA+n0WCqjJlDyncj25+LcwZGY3p8aSKRWhBifeJK8IXqRO7qheU/17A/w 8rsG8IrkDtSs6O6quYpKnaTevMHUMJMfOVf9cviMxgrczfE76+GZuEmSjmBnMafqVLj2cT2Aa5TVV cGqjpBaTz0urNqqEow66cbxxsOtGTZT9zuf5uS9ICmXQHOZddCCiNSmE8aDAdOEcZtFfWCvim40ag RXxXWBkfak7+0K9tm7WQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVvyJ-001rRW-13; Tue, 15 Aug 2023 15:28:39 +0000 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174] helo=mx0b-0016f401.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qVvxu-001rEw-2J for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 15:28:16 +0000 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37FEFiP7008910; Tue, 15 Aug 2023 08:28:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=7VqvIZ5Kw60KAdQqYaseDlv9dFqfiOw23a8I9hkx92I=; b=E2M9DngD/Rmv8OUgqjF5lomP4SrwtBnguQUDbCW1e50WJDG+ikp9IfwkAmpBga+TaB5r Mtrj2Ay/qd3zGMIBtjpXuBMsK1BzuGr/hIEEhJfYBxcrR2SDZvYmn3KK9kTE7q2bR1zD tpJcAp8BtAQIezIHOq9l1YjRXEZ68ptoXjKysEWSPxjwSyrChSzkZdis03UrBW2Wkg+h k2NmK00qDcEFsE0lzGpnTj6iRyg65twHKHEJAvSPSYfVnUXamBVFQrTZ61Md2QnbTKJo KH7kx8c28EB+IDw7zYD7ABHAqUiDdScvnV+5X45PC0vaPBQ2hsl5WOWT+KeMJp5urqR0 vA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3sgaydr8a1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 15 Aug 2023 08:28:02 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 15 Aug 2023 08:28:00 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 15 Aug 2023 08:28:00 -0700 Received: from localhost.localdomain (unknown [10.28.36.167]) by maili.marvell.com (Postfix) with ESMTP id 7EC783F703F; Tue, 15 Aug 2023 08:27:57 -0700 (PDT) From: Amit Singh Tomar To: , CC: , , , , , , Amit Singh Tomar Subject: [RFC 06/12] fs/resctrl: Extend schemata read for priority partition control Date: Tue, 15 Aug 2023 20:57:06 +0530 Message-ID: <20230815152712.1760046-7-amitsinght@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230815152712.1760046-1-amitsinght@marvell.com> References: <20230815152712.1760046-1-amitsinght@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: pYw_XwpvMpH1BeJ9R0vvSqmdqsVVQ3z2 X-Proofpoint-ORIG-GUID: pYw_XwpvMpH1BeJ9R0vvSqmdqsVVQ3z2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-15_16,2023-08-15_02,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_082814_764511_D2AA12BF X-CRM114-Status: GOOD ( 19.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org At present, "schemata" file under resource control group reveals information about Cache portion bitmap and Memory Bandwidth allocation. With the introduction of priority partition control "schemata" is updated to adopt priority value. Let's enable support for reading the priority values for "schemata" file. Signed-off-by: Amit Singh Tomar --- drivers/platform/mpam/mpam_resctrl.c | 4 ++++ fs/resctrl/ctrlmondata.c | 15 ++++++++++++--- include/linux/resctrl.h | 4 ++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c index cc843f1b0fb7..b491a0f897fd 100644 --- a/drivers/platform/mpam/mpam_resctrl.c +++ b/drivers/platform/mpam/mpam_resctrl.c @@ -735,7 +735,11 @@ static int mpam_resctrl_resource_init(struct mpam_resctrl_res *res) if (has_ppart) { r->priority_cap = true; + if (class->props.dspri_wd > 0x10) + class->props.dspri_wd = 0x10; + r->dspri_default_ctrl = BIT_MASK(class->props.dspri_wd) - 1; + r->dspri_data_width = (class->props.dspri_wd + 3) / 4; } /* diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c index b19ac2509e38..8c8a4d09d22c 100644 --- a/fs/resctrl/ctrlmondata.c +++ b/fs/resctrl/ctrlmondata.c @@ -379,7 +379,7 @@ static void show_doms(struct seq_file *s, struct resctrl_schema *schema, int clo struct rdt_resource *r = schema->res; struct rdt_domain *dom; bool sep = false; - u32 ctrl_val; + u32 ctrl_val, dspri_ctrl_val; /* Walking r->domains, ensure it can't race with cpuhp */ lockdep_assert_cpus_held(); @@ -395,9 +395,18 @@ static void show_doms(struct seq_file *s, struct resctrl_schema *schema, int clo ctrl_val = resctrl_arch_get_config(r, dom, closid, schema->conf_type); - seq_printf(s, r->format_str, dom->id, max_data_width, - ctrl_val); + if (r->priority_cap) { + r->dspri_show = true; + dspri_ctrl_val = resctrl_arch_get_config(r, dom, closid, + CDP_NONE); + seq_printf(s, r->format_str, dom->id, max_data_width, ctrl_val, + r->dspri_data_width, dspri_ctrl_val); + } else + seq_printf(s, r->format_str, dom->id, max_data_width, + ctrl_val); + sep = true; + r->dspri_show = false; } seq_puts(s, "\n"); } diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index d5b0661c0f70..d7100c330945 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -199,12 +199,14 @@ struct resctrl_membw { * @mon_capable: Is monitor feature available on this machine * @priority_capable: Is priority partitioning feature available on this machine * @dspri_store: + * @dspri_show: flag to indicate downstream priority read * @num_rmid: Number of RMIDs available * @cache_level: Which cache level defines scope of this resource * @cache: Cache allocation related data * @membw: If the component has bandwidth controls, their properties. * @domains: RCU list of all domains for this resource * @name: Name to use in "schemata" file. + * @dspri_data_width Character width of dspri value when displaying * @data_width: Character width of data when displaying * @default_ctrl: Specifies default cache cbm or memory B/W percent. * @dspri_default_ctrl: Specifies default downstream priority value. @@ -219,6 +221,7 @@ struct rdt_resource { bool mon_capable; bool priority_cap; bool dspri_store; + bool dspri_show; int num_rmid; int cache_level; struct resctrl_cache cache; @@ -226,6 +229,7 @@ struct rdt_resource { struct list_head domains; char *name; int data_width; + int dspri_data_width; u32 default_ctrl; u32 dspri_default_ctrl; const char *format_str;