From: Dave Martin <Dave.Martin@arm.com>
To: Zeng Heng <zengheng4@huawei.com>
Cc: james.morse@arm.com, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
jonathan.cameron@huawei.com, xiexiuqi@huawei.com,
"Wangshaobo (bobo)" <bobo.shaobowang@huawei.com>
Subject: Re: [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 2/5] arm_mpam: Read monitor value with new closid/rmid pair
Date: Fri, 3 Jan 2025 15:31:39 +0000 [thread overview]
Message-ID: <Z3gC25189W5UYENX@e133380.arm.com> (raw)
In-Reply-To: <8fa84731-1ae6-e40f-3594-3241b1ee8bb4@huawei.com>
On Fri, Jan 03, 2025 at 02:55:17PM +0800, Zeng Heng wrote:
>
>
> On 2024/12/13 0:18, Dave Martin wrote:
> > Hi,
> >
> > On Sat, Dec 07, 2024 at 05:21:33PM +0800, Zeng Heng wrote:
[...]
> > > Based on the example provided, the conversion relationship between
> > > closid/rmid and (req)PARTID/PMG is:
> > >
> > > (req)PARTID = (rmid.req_idx * n) + closid,
> > > PMG = rmid.pmg.
> >
> > It seemed more natural to me for the PARTIDs assigned to a particular
> > CLOSID to be consecutively numbered (see [1]), though it works either
> > way.
> >
> > Otherwise, the approach makes sense.
> >
>
>
> After attempting to change the mapping method in practice, I found that
> there are some following advantages of the current method which keeps
> intPARTIDs are mapped to the first n IDs:
Thanks for having a go.
> 1. Because closid is exactly equal to intPARTID, and the conversion
> relationship between closid and intPARTID remains unchanged under the
> current method (still only call the resctrl_get_config_index() for
> conversion), maintaining the original semantics during the MPAM
> configuration updating;
You are right about this, but I think this is just moving complexity
around rather than eliminating it?
I've tried various approaches, and there there always seems to be one
ugly step somewhere; either something in mpam_devices.c that feels like
it should be in mpam_resctrl.c, or something in mpam_resctrl.c that
feels like it should be in mpam_devices.c.
> 2. Since there is no need to create a new transformation (like
> closid2intpartid()) between closid and intPARTID, this can reduce the
> work of function adaptations, such as in resctrl_arch_update_one(),
> resctrl_arch_get_config(), and so on, which doesn't need any extra
> adaptions and keeps things as simple as possible.
>
> Looking forward to your comments.
>
>
> Greeting for new year,
> Zeng Heng
>
Happy New Year to you too!
What you say is true, but I think the runtime cost of the conversions
is going to be trivial compared with the cost of the actual MSC
programming.
For context: I'm hoping to factor the code so that the conversion is as
cleanly separated out as possible, so that it would be straightforward
to move to an arbitrary mapping in the future if it is possible to
agree changes in the core resctrl interface so that the PARTID/PMG
allocations can be dynamic. If we do that, the conversion would
probably become a simple table lookup.
This factoring seems more important than which precise mapping we
choose right now.
But in the interests of improving PARTID Narrowing support sooner,
I think that going straight to dynamic allocation is not the best
approach -- so my idea is to prepare for that on the MPAM driver side,
but not prioritise developing a dynamic approach until after the
resctrlfs refactoring and the MPAM driver are merged upstream.
Does that make sense?
Cheers
---Dave
next prev parent reply other threads:[~2025-01-03 15:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 9:21 [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 0/5] arm_mpam: Introduce the Narrow-PARTID feature for MPAM driver Zeng Heng
2024-12-07 9:21 ` [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 1/5] arm_mpam: Introduce the definitions of intPARTID and reqPARTID Zeng Heng
2024-12-07 9:21 ` [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 2/5] arm_mpam: Read monitor value with new closid/rmid pair Zeng Heng
2024-12-12 16:18 ` Dave Martin
2024-12-19 13:39 ` Zeng Heng
2025-01-03 6:55 ` Zeng Heng
2025-01-03 15:31 ` Dave Martin [this message]
2025-01-04 9:15 ` Zeng Heng
2024-12-07 9:21 ` [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 3/5] arm_mpam: Set INTERNAL as needed when setting MSC controls Zeng Heng
2024-12-07 9:21 ` [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 4/5] arm_mpam: Automatically synchronize the configuration of all sub-monitoring groups Zeng Heng
2024-12-12 16:18 ` Dave Martin
2024-12-20 9:36 ` Zeng Heng
2025-01-02 16:34 ` Dave Martin
2024-12-07 9:21 ` [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 5/5] arm_mpam: Adapting the closid/rmid matching determination functions Zeng Heng
2024-12-12 16:19 ` Dave Martin
2024-12-20 7:45 ` Zeng Heng
2024-12-12 16:17 ` [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 0/5] arm_mpam: Introduce the Narrow-PARTID feature for MPAM driver Dave Martin
2024-12-20 10:59 ` Zeng Heng
2025-01-02 16:45 ` Dave Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z3gC25189W5UYENX@e133380.arm.com \
--to=dave.martin@arm.com \
--cc=bobo.shaobowang@huawei.com \
--cc=james.morse@arm.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiexiuqi@huawei.com \
--cc=zengheng4@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).