From patchwork Sat Jan 4 10:12:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zeng Heng X-Patchwork-Id: 13926174 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 666C0E77188 for ; Sat, 4 Jan 2025 10:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version: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:In-Reply-To:References:List-Owner; bh=z3TZ/ttulaT47achgys7RcCkrw9yTIGSNlXm972gG1s=; b=iOsMjfbl/eC0RVk0znafnDPV2E 2TiAHdmbEXP04biyt5LWgFSx8a+IuENjQLXko2mf5+YfjMozc2XVPYwGoCwwxxKRDGKePNuam8ws5 k8iaFzvfn8DnfQQCsCGTfvIiEex8wUQMdz6bBA3QOTBgFPfMH0Gg9IbVKDHtkUESN5HxfGsg0MRzq IEkk7adWhQ+uuf87AtoAksJ6POIcZ6fFq1KuUKZCyeKQWRp8IznyBb0yESnEEFry6azbOZamYBzW0 CZz3EigprKiOHIvp3mXSZX+NItuy22c9Xb2QK06NDMdw4YUeuTNU5nGE+Ao4fXgV28Hn1ANjFu4Rs F6rhgHEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tU0z7-0000000EpnQ-1LEj; Sat, 04 Jan 2025 10:02:21 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tU0xu-0000000EpXf-2rWG for linux-arm-kernel@lists.infradead.org; Sat, 04 Jan 2025 10:01:09 +0000 Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YQG9l1kNBz22k3Z; Sat, 4 Jan 2025 17:58:51 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id EB1D414011D; Sat, 4 Jan 2025 18:01:01 +0800 (CST) Received: from huawei.com (10.175.103.91) by kwepemf100008.china.huawei.com (7.202.181.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 4 Jan 2025 18:01:01 +0800 From: Zeng Heng To: , CC: , , , Subject: [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v4 0/5] arm_mpam: Introduce the Narrow-PARTID feature for MPAM driver Date: Sat, 4 Jan 2025 18:12:19 +0800 Message-ID: <20250104101224.873926-1-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemf100008.china.huawei.com (7.202.181.222) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250104_020106_875643_E0B0E62F X-CRM114-Status: GOOD ( 10.49 ) 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 The patch set is applied for mpam/snapshot/v6.12-rc1 branch of https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git repository. The narrow-partid feature in MPAM allows for a more efficient use of PARTIDs by enabling a many-to-one mapping of reqpartids (requested PARTIDs) to intpartids (internal PARTIDs). This mapping reduces the number of unique PARTIDs needed, thus allowing more tasks or processes to be monitored and managed with the available resources. For a mixture of MSCs system, for MSCs that do not support narrow-partid, we use the PARTIDs exceeding the number of closids as reqPARTIDs for expanding the monitoring groups. In order to keep the existing resctrl API interface, the rmid contains both req_idx and PMG information instead of PMG only under the MPAM driver. The req_idx represents the req_idx-th sub-monitoring group under the control group. The new rmid would be like: rmid = (req_idx << shift | pmg). The new conversion relationship between closid/rmid and (req)PARTID/PMG is: (req)PARTID = (rmid.req_idx * n) + closid PMG = rmid.pmg Each intPARTID has m reqPARTIDs, which are used to expand the number of monitoring groups under one control group. Therefore, the number of monitoring groups is no longer limited by the range of MPAM PMG, which enhances the extensibility of the system's monitoring capabilities. --- Compared with v1: - Rebase this patch set on latest MPAM driver of the v6.12-rc1 branch. Compared with v2: - Refactor closid/rmid pair translation - Simplify the logic of synchronize configuration - Remove reqPARTID source bitmap Compared with v3: - Add limitation of the Narrow-PARTID feature (See Patch 2). - Remove redundant reqpartid2closid() and reqpartid_pmg2rmid(). - Refactor closid_rmid2reqpartid() partially. - Merge the PARTID conversion-related patches into a single patch for bisectability. - Skip adaptation of resctrl_arch_set_rmid() which is going to be removed. --- Dave Martin (1): arm_mpam: Set INTERNAL as needed when setting MSC controls Zeng Heng (4): arm_mpam: Introduce the definitions of intPARTID and reqPARTID arm_mpam: Add limitation for the Narrow-PARTID feature arm_mpam: Provide conversion method for new closid/rmid pairs arm_mpam: Automatically synchronize the configuration of all sub-monitoring groups drivers/platform/arm64/mpam/mpam_devices.c | 61 ++++++-- drivers/platform/arm64/mpam/mpam_internal.h | 5 + drivers/platform/arm64/mpam/mpam_resctrl.c | 152 +++++++++++++++----- 3 files changed, 174 insertions(+), 44 deletions(-) -- 2.25.1