From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77D0D21A44D for ; Mon, 17 Feb 2025 13:36:15 +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=1739799377; cv=none; b=FQOSfqH/SIQ0aEIksY6GrjVhSIw8pJPiBt3GT0RbHMhCKUhRmmDzaFS3A3CBMzZuThjc8gl3pBmUJ6YzvJoMWGepPsMcZXteux6ZHJ+THl8aZy0FaUSnYGURZ86BlR4jiP2uESZ9MJmyz1kJW1fLTcseFsbHfTGz9dBrEWMhpko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739799377; c=relaxed/simple; bh=tz0LkNVtJUv6tJOv13c+7itHnzABgVw6BZR5ypOky/M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=vGj9rfq7Hu4LUXe8pQRPsE6iJFF/86HnBkdTlzCgcmnxhXMw9JR9coIVyTlyW+FdwOrfteprgnH17+GkaBU1EBWP5nMX5OWktAgLMODvXd1K9TiPx3pRRiDna/LpIoVLs6EESkuhN7Jt6Kzmbv+YY2zlwYPIcZro+ct95s/tQ78= 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 C59CE13D5; Mon, 17 Feb 2025 05:36:33 -0800 (PST) Received: from e133380.arm.com (e133380.arm.com [10.1.197.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC9EB3F6A8; Mon, 17 Feb 2025 05:36:13 -0800 (PST) Date: Mon, 17 Feb 2025 13:36:07 +0000 From: Dave Martin To: Zeng Heng Cc: james.morse@arm.com, bobo.shaobowang@huawei.com, jonathan.cameron@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH mpam mpam/snapshot/v6.14-rc1 3/5] arm_mpam: Provide conversion method for new closid/rmid pairs Message-ID: References: <20250217031852.2014939-1-zengheng4@huawei.com> <20250217031852.2014939-4-zengheng4@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi, On Mon, Feb 17, 2025 at 02:18:44PM +0800, Zeng Heng wrote: > Hi Martin, > > On 2025/2/17 11:18, Zeng Heng wrote: > > The MPAM driver statically assigns all reqPARTIDs to respective intPARTIDs. > > For the new rmid allocation strategy, it will check if there is an > > available rmid of any reqPARTID which belongs to the input closid, not just > > the rmids belonging to the closid. > > > > 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). > > > > To consider future compatibility with dynamically allocated reqpartid, > should I refactor the rmid? > > Instead of defining rmid.req_idx, we could place the entire reqpartid > directly within rmid. In This way, the allocation of reqpartid will no > longer be constrained by the static allocation of closid, facilitating > future compatibility with dynamic allocation mechanisms. > > In this case, it needs to refactor the resctrl_arch_rmid_idx_encode() > and resctrl_arch_rmid_idx_decode(), and we can simplify > closid_rmid2reqpartid() to rmid2reqpartid(). > > What are your thoughts on this idea? Thank you in advance for your > reply. > > Best regards, > Zeng Heng Does this mean that the RMID must be expanded to cover all possible (reqPARTID, PMG) combinations? A single reqPARTID cannot be allocated to two different resctrl control groups at the same time, even though a PMG value can be reused across multiple control groups -- so it sounds like your proposal would require changes in the resctrl core code as well as possibly requiring a larger rmid_ptrs table. But I might have misunderstood what you are proposing here... Can you illustrate with one or two examples? Cheers ---Dave