From mboxrd@z Thu Jan 1 00:00:00 1970 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 E7ED3CA0FE6 for ; Fri, 1 Sep 2023 12:40:48 +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:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T44MqSr+GDT61hgM2xDX1SheiAymccx9pzPq949ThU4=; b=XawryWKagzDNCR fFU2kW/z1BbKxeoquYN2f9jW3ROVBs/rAR7T9C9Rk/jS2RjghrAyE1ukLhvC0CsceEf3Eae0tbY2Z EVWZE3xotoGTZN8QkmahkMjjUP9u4gTjPe8smKixmzxyh0doBEnTYezWT7EOVmGUImygVGHJ3kjen j2hHI55pxpttTGbg+Cy0OrHnrJCLnS4jajyTeqA/MNn/l8hMJ2yquMwF4D0fLzKBAONzPfYwWQzXT zu7CEgtNOL4K3/KqV+B1hQGePp/YeYNu5tWOFRc0rb/jPDj9hFqNzxmBVuxYDO2511cTItMd1LcDz f/sfouM1rcfi2DIE2ykQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qc3Rk-00HTWp-0M; Fri, 01 Sep 2023 12:40:20 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qc3ID-00HQA2-19 for linux-arm-kernel@lists.infradead.org; Fri, 01 Sep 2023 12:30:31 +0000 Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RccgV5ZvCz67pFc; Fri, 1 Sep 2023 20:25:26 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 1 Sep 2023 13:30:20 +0100 Date: Fri, 1 Sep 2023 13:30:19 +0100 From: Jonathan Cameron To: Amit Singh Tomar CC: , , , , , , , Subject: Re: [RFC 02/12] arm_mpam: resctrl: Detect priority partitioning capability Message-ID: <20230901133019.000033b2@Huawei.com> In-Reply-To: <20230815152712.1760046-3-amitsinght@marvell.com> References: <20230815152712.1760046-1-amitsinght@marvell.com> <20230815152712.1760046-3-amitsinght@marvell.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230901_053029_681924_3A4B4AF5 X-CRM114-Status: GOOD ( 22.47 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 15 Aug 2023 20:57:02 +0530 Amit Singh Tomar wrote: > ARM MPAM supports different control that can be applied to different > resources in the system, for instance priority partitioning control > where priority value is generated from one MSC, propagates over > interconnect to other MSC (known as downstream priority), or can be > applied within an MSC for internal operations. Hi Amit, This talks about INTPRI as well as DSPRI, but only checks for DSPRI. I couldn't work out why my INTPRI test wasn't resulting in anything new turning up in schemata. Should make that clear However even better would be to enable both and we definitely want an interface that allows for either or both. Jonathan > > This change lets the resctrl know the about MSC's priority partitioning > capability. > > Signed-off-by: Amit Singh Tomar > --- > drivers/platform/mpam/mpam_resctrl.c | 14 ++++++++++++++ > include/linux/resctrl.h | 4 ++++ > 2 files changed, 18 insertions(+) > > diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c > index 1dbfb6f6dd34..09618d9ceb1d 100644 > --- a/drivers/platform/mpam/mpam_resctrl.c > +++ b/drivers/platform/mpam/mpam_resctrl.c > @@ -435,6 +435,16 @@ static bool cache_has_usable_cpor(struct mpam_class *class) > return (class->props.cpbm_wd <= RESCTRL_MAX_CBM); > } > > +static bool cache_has_usable_priority_part(struct mpam_class *class) > +{ > + struct mpam_props *cprops = &class->props; > + > + if (!mpam_has_feature(mpam_feat_dspri_part, cprops)) > + return false; > + > + return (class->props.dspri_wd <= RESCTRL_MAX_DSPRI); > +} > + > static bool cache_has_usable_csu(struct mpam_class *class) > { > struct mpam_props *cprops; > @@ -691,6 +701,7 @@ static int mpam_resctrl_resource_init(struct mpam_resctrl_res *res) > res->resctrl_res.rid == RDT_RESOURCE_L3) { > bool has_csu = cache_has_usable_csu(class); > bool has_mbwu = class_has_usable_mbwu(class); > + bool has_ppart = cache_has_usable_priority_part(class); > > /* TODO: Scaling is not yet supported */ > r->cache.cbm_len = class->props.cpbm_wd; > @@ -718,6 +729,9 @@ static int mpam_resctrl_resource_init(struct mpam_resctrl_res *res) > exposed_alloc_capable = true; > } > > + if (has_ppart) > + r->priority_cap = true; > + > /* > * MBWU counters may be 'local' or 'total' depending on where > * they are in the topology. If The counter is on the L3, its > diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h > index 3ad308e9e226..a98ba5828211 100644 > --- a/include/linux/resctrl.h > +++ b/include/linux/resctrl.h > @@ -38,6 +38,8 @@ int proc_resctrl_show(struct seq_file *m, > */ > #define RESCTRL_MAX_CBM 32 > > +#define RESCTRL_MAX_DSPRI 63 > + > /* The format for packing fields into the u64 'id' exposed to user-space */ > #define RESCTRL_ID_CLOSID GENMASK_ULL(31, 0) > #define RESCTRL_ID_RMID GENMASK_ULL(63, 32) > @@ -195,6 +197,7 @@ struct resctrl_membw { > * @rid: The index of the resource > * @alloc_capable: Is allocation available on this machine > * @mon_capable: Is monitor feature available on this machine > + * @priority_capable: Is priority partitioning feature available on this machine > * @num_rmid: Number of RMIDs available > * @cache_level: Which cache level defines scope of this resource > * @cache: Cache allocation related data > @@ -212,6 +215,7 @@ struct rdt_resource { > int rid; > bool alloc_capable; > bool mon_capable; > + bool priority_cap; > int num_rmid; > int cache_level; > struct resctrl_cache cache; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel