From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=113.46.200.217 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796023757; b=KNo8eOBZouoqhiZuHH6EVw8bFkkEc4WXKvL0dzghAPHAhlfZwkj0zmA5F1Rfh9Hne+mJ UZ2yV8ZJqKTPmMJHwGoaoiys2r9Ught9a/ors2xNMccQFC6ASvJQg6w8PS6E0fQtzINdR od+SZvLQnTuBBE4TtrFRsrkZelW2+goIj6UF4/E0VsOhippYiPfzUyBGmkt97JLam2tjX XwnapOZa0M6+LRy9MyjuMfFhAqaNuSPwFmmKssTEOKsQ/oHMQ/1i54ZCz+dX3Pe7tp9/o sCQpPh3BPW6i3AGUz8NjvPvl4AMLrzGEqCa73dvTkeKIUscnG8bNzJJwQ28Jk+dS8PA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796023757; h=DMARC-Filter:dkim-signature:Received:Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:CC:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Originating-IP: X-ClientProxiedBy; bh=ORpLcK0Biws9gDrd7xpIQt0uSj+6MY/PtyC3D88faXg=; b=pLF2JAh6MCiWPRdZbHdS9qGaT1qCMwjqB3rV8eCrPcyOoHKglCURunnt+gsVYQSQTEsH vMTd9NjTmTwwhvtpElGW9dP4ie4lU+pGItVPAJQRi/sNI9eXylOKQ495GrF/iw9Q/7kLC tGU7lqan4mTp3GceQScHNOx+cVgOyOJxujduVJ1uGRFLCTU/TdlmuqzjN1dmXLOfF0T2i tsZrY6CRFy9iFWrj+0AOOeXz3CgX6JKKvzFO6QRGQ4UncWoZtLh+5QEPMXodIVID84FOa htip6sB+5hbLOWcx7LxhaDL54OK3ZFXpiih/AASedlSFYNRD00RjLPM+Z4i+u4db4tw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=3YwTgyKX; arc=none smtp.remote-ip=113.46.200.217 Received: from canpmsgout02.his.huawei.com (canpmsgout02.his.huawei.com [113.46.200.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C9EE606A32A; Mon, 30 Nov 2026 07:29:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3C9EE606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=3YwTgyKX dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=ORpLcK0Biws9gDrd7xpIQt0uSj+6MY/PtyC3D88faXg=; b=3YwTgyKXe3U3WZNWf/Hpzmva1eVzJmvIF5KZdEvnO3I97Z1T2FZQN3jghRdKgHOqeTgnsefF5 8gCwjrvCuNmdcIbFQ6R91DU7HdgIeusfEn14/IiW3bVuHUNL7SlAM231BQ2sQ+a5w34nm/INHKX Zf9xLEqbdOEZQjN3rDTKBis= Received: from mail.maildlp.com (unknown [172.19.163.104]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4jdFwt2MgjzcZxt; Mon, 30 Nov 2026 15:27:58 +0800 (CST) Received: from kwepemk200008.china.huawei.com (unknown [7.202.194.74]) by mail.maildlp.com (Postfix) with ESMTPS id D33104056E; Mon, 30 Nov 2026 15:29:12 +0800 (CST) Received: from [10.67.110.68] (10.67.110.68) by kwepemk200008.china.huawei.com (7.202.194.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Mon, 30 Nov 2026 15:29:11 +0800 Message-ID: <228f8604-b48c-47dc-84f2-6056b19a2695@huawei.com> Date: Mon, 30 Nov 2026 15:29:11 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [External] Re: [RFC PATCH 00/13] resctrl: Introduce a framework for logical control IDs To: yunhui cui CC: , , , , , , , , , , , , , , , , , , , , , , , References: <20261130022929.71748-1-cuiyunhui@bytedance.com> <0c2c448b-0726-4ea5-b772-70646d8b51c9@huawei.com> From: Jinjie Ruan In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemk200008.china.huawei.com (7.202.194.74) 在 2026/11/30 14:56, yunhui cui 写道: > Hi Jinjie, > > On Mon, Nov 30, 2026 at 2:15 PM Jinjie Ruan wrote: >> >> >> >> 在 2026/11/30 10:29, Yunhui Cui 写道: >>> Some resource controllers can accept a wider request-ID namespace than >>> the number of configuration entries they provide. Arm MPAM PARTID >>> narrowing is one example: requests carry a PARTID, while an MSC maps it >>> to a smaller internal PARTID table. A future RISC-V CBQRI backend is >> >> We have been working on narrow partid for a long time. Could you please >> drop the patches related to MPAM narrow partid? >> >> Link: >> https://lore.kernel.org/all/20261020134239.3921377-1-ruanjinjie@huawei.com/ > > Thanks for pointing me to the v10 series. > > This RFC focuses on the generic resctrl logical-control-ID framework. > It is not intended to modify or extend MPAM's Narrow-PARTID > functionality itself. > > The idea is for generic resctrl to provide a common lifecycle, with > each architecture backend integrating according to its hardware model: > x86 retains its direct-index behavior, MPAM implements the > mapped-controller interfaces, and a future RISC-V CBQRI backend can > use the same framework. Hi Yunhui, Don't you think it is too early to provide a framework now? Currently, the narrow partid on the mpam side cannot work properly on the mainline, and RISC-V seems to have only just started providing support. There are some suggestions from James on v8, where he recommends implementing the simplest static narrow partid first. Should we follow James's suggestion in v8 and ensure that these features work properly across different architectures before considering the framework? v8: https://lore.kernel.org/all/20260413085405.1166412-1-zengheng4@huawei.com/ https://lore.kernel.org/all/88c6c8cd-5da7-4c28-8d5c-7d6489e5913f@picoheart.com/ > > The current series is based on next-20261127, which does not include > the v10 patches, so the MPAM backend changes are implemented against > the current code. In a subsequent revision, even if v10 has not been > merged, I can use it as the base for the MPAM part and rebase this > series on top of it. > > Thanks, > Yunhui > >> >> >>> expected to need a similar mapping from request RCIDs to controller-local >>> entries. Resctrl currently uses one ID both to identify a control group >>> and to select its hardware entry, so the smallest table limits the number >>> of groups exposed to user space. >>> >>> The framework uses a logical control ID in generic resctrl while each >>> architecture selects a hardware entry according to its own model: >>> >>> generic resctrl >>> logical control ID >>> | >>> +------------------+------------------+ >>> | | | >>> x86 arm64 MPAM RISC-V CBQRI >>> direct index MSC mapping mapping (proposed) >>> | | | >>> hardware entry internal PARTID controller entry >>> >>> Without controller-local request-ID mapping, the same request ID directly >>> indexes every controller. If g1 configures only A and g2 only B, g1 >>> cannot select its private entry in A and B's root entry while g2 makes >>> the opposite selection. Each group therefore consumes an entry in both >>> controllers. Controller-local mapping makes these selections independent, >>> so A needs entries only for the root group and g1 while B needs only the >>> root group and g2. >>> >>> This series gives control groups logical IDs. A new group initially >>> selects the root policy and consumes no private entry on a narrowing >>> controller. Its first explicit policy write allocates and programs an >>> entry only on the affected controllers, then publishes the >>> request-to-internal ID mapping. Controllers that have not been configured >>> continue to follow the root policy. A same-value write still creates a >>> private policy, so a later root update does not change it. >>> >>> Entry reservation is completed before a multi-controller policy update >>> and mapping changes are published only after the entries are programmed. >>> Group removal maps requests back to the root entry before an internal >>> entry or logical ID can be reused. CDP keeps separate data and code root >>> entries so the default policies remain distinct. >>> >>> Identity-mapped architectures retain their current behavior, and I/O >>> allocation continues to address a hardware entry directly. The generic >>> framework supports both direct-index and mapped controllers. The RISC-V >>> backend itself is outside this series. >>> >>> Base: next-20261127 >>> >>> Yunhui Cui (13): >>> resctrl: Introduce interfaces for logical control IDs >>> resctrl: Add prepare, commit and abort hooks for control updates >>> resctrl: Add a release hook before logical control ID reuse >>> arm_mpam: Record PARTID narrowing capacity per MSC >>> arm_mpam: Select PARTID narrowing per component >>> arm_mpam: Add an internal PARTID allocator >>> arm_mpam: Add request-to-internal PARTID mapping >>> arm_mpam: Apply PARTID narrowing to resctrl control groups >>> arm_mpam: Separate request and internal PARTID limits >>> arm_mpam: Map CDP data and code defaults separately >>> arm_mpam: Add kunit tests for PARTID narrowing >>> selftests/resctrl: Add a test for control ID allocation and reuse >>> docs/resctrl: Document logical control IDs and hardware entries >>> >>> Documentation/filesystems/resctrl.rst | 88 ++ >>> arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 38 +- >>> drivers/resctrl/mpam_devices.c | 857 +++++++++++++++++- >>> drivers/resctrl/mpam_internal.h | 25 +- >>> drivers/resctrl/mpam_resctrl.c | 288 +++++- >>> drivers/resctrl/test_mpam_devices.c | 619 ++++++++++++- >>> drivers/resctrl/test_mpam_resctrl.c | 172 ++++ >>> fs/resctrl/ctrlmondata.c | 28 +- >>> fs/resctrl/rdtgroup.c | 18 +- >>> include/linux/resctrl.h | 17 +- >>> .../testing/selftests/resctrl/ctrl_id_test.c | 380 ++++++++ >>> tools/testing/selftests/resctrl/resctrl.h | 1 + >>> .../testing/selftests/resctrl/resctrl_tests.c | 1 + >>> 13 files changed, 2470 insertions(+), 62 deletions(-) >>> create mode 100644 tools/testing/selftests/resctrl/ctrl_id_test.c >>> >> >