linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Newman <peternewman@google.com>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: "Moger, Babu" <bmoger@amd.com>,
	babu.moger@amd.com, corbet@lwn.net, tony.luck@intel.com,
	 tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	 dave.hansen@linux.intel.com, james.morse@arm.com,
	dave.martin@arm.com,  fenghuay@nvidia.com, x86@kernel.org,
	hpa@zytor.com, paulmck@kernel.org,  akpm@linux-foundation.org,
	thuth@redhat.com, rostedt@goodmis.org,  ardb@kernel.org,
	gregkh@linuxfoundation.org, daniel.sneddon@linux.intel.com,
	 jpoimboe@kernel.org, alexandre.chartre@oracle.com,
	 pawan.kumar.gupta@linux.intel.com, thomas.lendacky@amd.com,
	 perry.yuan@amd.com, seanjc@google.com, kai.huang@intel.com,
	 xiaoyao.li@intel.com, kan.liang@linux.intel.com,
	xin3.li@intel.com,  ebiggers@google.com, xin@zytor.com,
	sohil.mehta@intel.com,  andrew.cooper3@citrix.com,
	mario.limonciello@amd.com,  linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,  maciej.wieczor-retman@intel.com,
	eranian@google.com, Xiaojian.Du@amd.com,  gautham.shenoy@amd.com
Subject: Re: [PATCH v13 00/27] x86/resctrl : Support AMD Assignable Bandwidth Monitoring Counters (ABMC)
Date: Wed, 21 May 2025 11:18:51 +0200	[thread overview]
Message-ID: <CALPaoCjTwySGX9i7uAtCWLKQpmELKP55xDLJhHmUve8ptsfFTw@mail.gmail.com> (raw)
In-Reply-To: <11465976-f030-4c1b-88c6-3eebf0c8f13b@intel.com>

Hi Babu/Reinette,

On Wed, May 21, 2025 at 1:44 AM Reinette Chatre
<reinette.chatre@intel.com> wrote:
>
> Hi Babu,
>
> On 5/20/25 4:25 PM, Moger, Babu wrote:
> > Hi Reinette,
> >
> > On 5/20/2025 1:23 PM, Reinette Chatre wrote:
> >> Hi Babu,
> >>
> >> On 5/20/25 10:51 AM, Moger, Babu wrote:
> >>> Hi Reinette,
> >>>
> >>> On 5/20/25 11:06, Reinette Chatre wrote:
> >>>> Hi Babu,
> >>>>
> >>>> On 5/20/25 8:28 AM, Moger, Babu wrote:
> >>>>> On 5/19/25 10:59, Peter Newman wrote:
> >>>>>> On Fri, May 16, 2025 at 12:52 AM Babu Moger <babu.moger@amd.com> wrote:
> >>>>
> >>>> ...
> >>>>
> >>>>>>> /sys/fs/resctrl/info/L3_MON/num_mbm_cntrs: Reports the number of monitoring
> >>>>>>> counters available for assignment.
> >>>>>>
> >>>>>> Earlier I discussed with Reinette[1] what num_mbm_cntrs should
> >>>>>> represent in a "soft-ABMC" implementation where assignment is
> >>>>>> implemented by assigning an RMID, which would result in all events
> >>>>>> being assigned at once.
> >>>>>>
> >>>>>> My main concern is how many "counters" you can assign by assigning
> >>>>>> RMIDs. I recall Reinette proposed reporting the number of groups which
> >>>>>> can be assigned separately from counters which can be assigned.
> >>>>>
> >>>>> More context may be needed here. Currently, num_mbm_cntrs indicates the
> >>>>> number of counters available per domain, which is 32.
> >>>>>
> >>>>> At the moment, we can assign 2 counters to each group, meaning each RMID
> >>>>> can be associated with 2 hardware counters. In theory, it's possible to
> >>>>> assign all 32 hardware counters to a group—allowing one RMID to be linked
> >>>>> with up to 32 counters. However, we currently lack the interface to
> >>>>> support that level of assignment.
> >>>>>
> >>>>> For now, the plan is to support basic assignment and expand functionality
> >>>>> later once we have the necessary data structure and requirements.
> >>>>
> >>>> Looks like some requirements did not make it into this implementation.
> >>>> Do you recall the discussion that resulted in you writing [2]? Looks like
> >>>> there is a question to Peter in there on how to determine how many "counters"
> >>>> are available in soft-ABMC. I interpreted [3] at that time to mean that this
> >>>> information would be available in a future AMD publication.
> >>>
> >>> We already have a method to determine the number of counters in soft-ABMC
> >>> mode, which Peter has addressed [4].
> >>>
> >>> [4]
> >>> https://lore.kernel.org/lkml/20250203132642.2746754-1-peternewman@google.com/
> >>>
> >>> This appears to be more of a workaround, and I doubt it will be included
> >>> in any official AMD documentation. Additionally, the long-term direction
> >>> is moving towards ABMC.
> >>>
> >>> I don’t believe this workaround needs to be part of the current series. It
> >>> can be added later when soft-ABMC is implemented.
> >>
> >> Agreed. What about the plans described in [2]? (Thanks to Peter for
> >> catching this!).
> >>
> >> It is important to keep track of requirements while working on a feature to
> >> ensure that the implementation supports the planned use cases. Re-reading that
> >> thread it is not clear to me how soft-ABMC's per-group assignment would look.
> >> Could you please share how you see it progress from this implementation?
> >> This includes the single event vs. multiple event assignment. I would like to
> >> highlight that this is not a request for this to be supported in this implementation
> >> but there needs to be a plan for how this can be supported on top of interfaces
> >> established by this work.
> >>
> >
> > Here’s my current understanding of soft-ABMC. Peter may have a more in-depth perspective on this.
> >
> > Soft-ABMC:
> > a. num_mbm_cntrs: This is a software-defined limit based on the number of active RMIDs that can be supported. The value can be obtained using the code referenced in [4].

I would call it a hardware-defined limit that can be probed by software.

The main question is whether this file returns the exact number of
RMIDs hardware can track or double that number (mbm_total_bytes +
mbm_local_bytes) so that the value is always measured in events.

There's also the mongroup-RMID overcommit use case I described
above[1]. On Intel we can safely assume that there are counters to
back all RMIDs, so num_mbm_cntrs would be calculated directly from
num_rmids.

I realized this use case is more difficult to implement on MPAM,
because a PARTID is effectively a CLOSID+RMID, so deferring assigning
a unique PARTID to a group also results in it being in a different
allocation group. It will work if the unmonitored groups could find a
way to share PARTIDs, but this has consequences on allocation - but
hopefully no worse than sharing CLOSIDs on x86.

There's a lot of interest in monitoring ID overcommit in Google, so I
think it's worth it for me to investigate the additional structural
changes needed in resctrl (i.e., breaking the FS-level association
between mongroups and HW monitoring IDs). Such a framework could be a
better fit for soft-ABMC. For example, if overcommit is allowed, we
would just report the number of simultaneous RMIDs we were able to
probe as num_rmids. I would want the same shared assignment scheduler
to be able to work with RMIDs and counters, though.

Thanks,
-Peter

[1] https://lore.kernel.org/lkml/CALPaoChSzzU5mzMZsdT6CeyEn0WD1qdT9fKCoNW_ty4tojtrkw@mail.gmail.com/

  reply	other threads:[~2025-05-21  9:19 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 22:51 [PATCH v13 00/27] x86/resctrl : Support AMD Assignable Bandwidth Monitoring Counters (ABMC) Babu Moger
2025-05-15 22:51 ` [PATCH v13 01/27] x86/cpufeatures: Add support for " Babu Moger
2025-05-22 20:51   ` Reinette Chatre
2025-05-27 17:23     ` Moger, Babu
2025-05-27 17:54       ` Reinette Chatre
2025-05-27 18:40         ` Moger, Babu
2025-05-27 23:42           ` Reinette Chatre
2025-05-28 16:18             ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 02/27] x86/resctrl: Add ABMC feature in the command line options Babu Moger
2025-05-15 22:51 ` [PATCH v13 03/27] x86/resctrl: Consolidate monitoring related data from rdt_resource Babu Moger
2025-05-22 20:52   ` Reinette Chatre
2025-05-27 18:49     ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 04/27] x86/resctrl: Detect Assignable Bandwidth Monitoring feature details Babu Moger
2025-05-22 20:54   ` Reinette Chatre
2025-05-27 19:52     ` Moger, Babu
2025-05-27 20:15     ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 05/27] x86/resctrl: Add support to enable/disable AMD ABMC feature Babu Moger
2025-05-22 20:56   ` Reinette Chatre
2025-05-27 20:21     ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 06/27] x86/resctrl: Introduce the interface to display monitor mode Babu Moger
2025-05-22 20:56   ` Reinette Chatre
2025-05-27 20:33     ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 07/27] x86/resctrl: Introduce interface to display number of monitoring counters Babu Moger
2025-05-15 22:51 ` [PATCH v13 08/27] x86/resctrl: Introduce mbm_cntr_cfg to track assignable counters at domain Babu Moger
2025-05-22 21:02   ` Reinette Chatre
2025-05-28 16:56     ` Moger, Babu
2025-05-28 17:34       ` Reinette Chatre
2025-05-28 19:05         ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 09/27] x86/resctrl: Introduce interface to display number of free MBM counters Babu Moger
2025-05-15 22:51 ` [PATCH v13 10/27] x86/resctrl: Add data structures and definitions for ABMC assignment Babu Moger
2025-05-22 21:10   ` Reinette Chatre
2025-05-28 19:15     ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 11/27] x86/resctrl: Implement resctrl_arch_config_cntr() to assign a counter with ABMC Babu Moger
2025-05-22 21:51   ` Reinette Chatre
2025-05-22 22:16     ` Luck, Tony
2025-05-23 21:08       ` Luck, Tony
2025-05-26 13:14         ` Peter Newman
2025-05-27 21:41           ` Luck, Tony
2025-05-28 21:41             ` Moger, Babu
2025-05-28 22:00               ` Luck, Tony
2025-05-28 22:13                 ` Luck, Tony
2025-05-28 23:48                   ` Moger, Babu
2025-06-09 14:01               ` Moger, Babu
2025-05-28 21:39     ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 12/27] x86/resctrl: Introduce event configuration modes Babu Moger
2025-05-22 22:05   ` Reinette Chatre
2025-05-29 15:21     ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 13/27] x86/resctrl: Add the functionality to assign MBM events Babu Moger
2025-05-22 22:41   ` Reinette Chatre
2025-05-29 16:05     ` Moger, Babu
2025-05-15 22:51 ` [PATCH v13 14/27] x86/resctrl: Add the functionality to unassign " Babu Moger
2025-05-22 22:49   ` Reinette Chatre
2025-05-29 16:25     ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 15/27] x86/resctrl: Report 'Unassigned' for MBM events in mbm_cntr_assign mode Babu Moger
2025-05-22 23:01   ` Reinette Chatre
2025-05-29 16:58     ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 16/27] x86/resctrl: Pass entire struct rdtgroup rather than passing individual members Babu Moger
2025-05-22 23:05   ` Reinette Chatre
2025-05-29 18:07     ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 17/27] x86/resctrl: Add the support for reading ABMC counters Babu Moger
2025-05-22 23:31   ` Reinette Chatre
2025-05-29 18:25     ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 18/27] x86/resctrl: Add definitions for MBM event configuration Babu Moger
2025-05-23  4:41   ` Reinette Chatre
2025-05-29 19:00     ` Moger, Babu
2025-05-29 20:58       ` Reinette Chatre
2025-06-03 13:41         ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 19/27] x86/resctrl: Add event configuration directory under info/L3_MON/ Babu Moger
2025-05-23  4:43   ` Reinette Chatre
2025-05-29 19:54     ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 20/27] x86/resctrl: Provide interface to update the event configurations Babu Moger
2025-05-23  4:45   ` Reinette Chatre
2025-05-29 22:35     ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 21/27] x86/resctrl: Introduce mbm_assign_on_mkdir to configure assignments Babu Moger
2025-05-23  4:48   ` Reinette Chatre
2025-05-29 23:03     ` Moger, Babu
2025-05-30 20:54       ` Reinette Chatre
2025-06-03 14:00         ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 22/27] x86/resctrl: Auto assign/unassign counters when mbm_cntr_assign is enabled Babu Moger
2025-05-15 22:52 ` [PATCH v13 23/27] x86/resctrl: Introduce mbm_L3_assignments to list assignments in a group Babu Moger
2025-05-23  4:47   ` Reinette Chatre
2025-05-30  0:55     ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 24/27] x86/resctrl: Introduce the interface to modify " Babu Moger
2025-05-26  9:48   ` Peter Newman
2025-05-27 15:24     ` Moger, Babu
2025-05-15 22:52 ` [PATCH v13 25/27] x86/resctrl: Hide the BMEC related files when mbm_cnt_assign is enabled Babu Moger
2025-05-15 22:52 ` [PATCH v13 26/27] x86/resctrl: Introduce the interface to switch between monitor modes Babu Moger
2025-05-15 22:52 ` [PATCH v13 27/27] x86/resctrl: Configure mbm_cntr_assign mode if supported Babu Moger
2025-05-19 15:59 ` [PATCH v13 00/27] x86/resctrl : Support AMD Assignable Bandwidth Monitoring Counters (ABMC) Peter Newman
2025-05-20 15:28   ` Moger, Babu
2025-05-20 16:06     ` Reinette Chatre
2025-05-20 17:51       ` Moger, Babu
2025-05-20 18:23         ` Reinette Chatre
2025-05-20 23:25           ` Moger, Babu
2025-05-20 23:44             ` Reinette Chatre
2025-05-21  9:18               ` Peter Newman [this message]
2025-05-21 23:03                 ` Reinette Chatre
2025-05-21 23:43                   ` Luck, Tony
2025-05-22  0:10                     ` Reinette Chatre
2025-05-22  0:21                       ` Luck, Tony
2025-05-22  8:47                         ` Peter Newman
2025-05-22 16:32                           ` Reinette Chatre
2025-05-22 17:21                           ` Luck, Tony
2025-05-22 15:44                   ` Moger, Babu
2025-05-22 16:33                     ` Reinette Chatre
2025-05-22 19:15                       ` Moger, Babu
2025-06-10 23:19                       ` Moger, Babu
2025-06-11 18:29                         ` Reinette Chatre
2025-06-11 21:21                           ` Moger, Babu
2025-05-21 14:27               ` Peter Newman
2025-05-21 23:05                 ` Reinette Chatre
2025-05-22  9:14                   ` Peter Newman
2025-05-22 16:33                     ` Reinette Chatre
2025-05-22 20:44 ` Reinette Chatre

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=CALPaoCjTwySGX9i7uAtCWLKQpmELKP55xDLJhHmUve8ptsfFTw@mail.gmail.com \
    --to=peternewman@google.com \
    --cc=Xiaojian.Du@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexandre.chartre@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ardb@kernel.org \
    --cc=babu.moger@amd.com \
    --cc=bmoger@amd.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=daniel.sneddon@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave.martin@arm.com \
    --cc=ebiggers@google.com \
    --cc=eranian@google.com \
    --cc=fenghuay@nvidia.com \
    --cc=gautham.shenoy@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jpoimboe@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=perry.yuan@amd.com \
    --cc=reinette.chatre@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=seanjc@google.com \
    --cc=sohil.mehta@intel.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=thuth@redhat.com \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    --cc=xin3.li@intel.com \
    --cc=xin@zytor.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).