public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Peter Newman <peternewman@google.com>
Cc: <babu.moger@amd.com>, <corbet@lwn.net>, <fenghua.yu@intel.com>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>,
	<paulmck@kernel.org>, <rdunlap@infradead.org>, <tj@kernel.org>,
	<peterz@infradead.org>, <yanjiewtw@gmail.com>,
	<kim.phillips@amd.com>, <lukas.bulwahn@gmail.com>,
	<seanjc@google.com>, <jmattson@google.com>, <leitao@debian.org>,
	<jpoimboe@kernel.org>, <rick.p.edgecombe@intel.com>,
	<kirill.shutemov@linux.intel.com>, <jithu.joseph@intel.com>,
	<kai.huang@intel.com>, <kan.liang@linux.intel.com>,
	<daniel.sneddon@linux.intel.com>, <pbonzini@redhat.com>,
	<sandipan.das@amd.com>, <ilpo.jarvinen@linux.intel.com>,
	<maciej.wieczor-retman@intel.com>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <eranian@google.com>,
	<james.morse@arm.com>
Subject: Re: [RFC PATCH v3 00/17] x86/resctrl : Support AMD Assignable Bandwidth Monitoring Counters (ABMC)
Date: Fri, 3 May 2024 14:14:57 -0700	[thread overview]
Message-ID: <ea56c630-80f4-4564-beb3-2b61e810a558@intel.com> (raw)
In-Reply-To: <CALPaoCiYFKeASPMDwzzaHLw4JiMtBB6DTyVPgt0Voe3c3Tav_A@mail.gmail.com>

Hi Peter,

On 5/2/2024 5:57 PM, Peter Newman wrote:
> Hi Reinette,
> 
> On Thu, May 2, 2024 at 4:21 PM Reinette Chatre
> <reinette.chatre@intel.com> wrote:
>>
>> Hi Peter and Babu,
>>
>> On 5/2/2024 1:14 PM, Moger, Babu wrote:
>>> Are you suggesting to enable ABMC by default when available?
>>
>> I do think ABMC should be enabled by default when available and it looks
>> to be what this series aims to do [1]. The way I reason about this is
>> that legacy user space gets more reliable monitoring behavior without
>> needing to change behavior.
> 
> I don't like that for a monitor assignment-aware user, following the
> creation of new monitoring groups, there will be less monitors
> available for assignment. If the user wants precise control over where
> monitors are allocated, they would need to manually unassign the
> automatically-assigned monitor after creating new groups.
> 
> It's an annoyance, but I'm not sure if it would break any realistic
> usage model. Maybe if the monitoring agent operates independently of
> whoever creates monitoring groups it could result in brief periods
> where less monitors than expected are available because whoever just
> created a new monitoring group hasn't given the automatically-assigned
> monitors back yet.
> 

I will respond in other thread.


>>
>> I thought there was discussion about communicating to user space
>> when an attempt is made to read data from an event that does not
>> have a counter assigned. Something like below but I did not notice this
>> in this series.
>>
>> # cat /sys/fs/resctrl/mon_data/mon_L3_00/mbm_total_bytes
>> Unassigned
>>
>>>
>>> Then provide the mount option switch back to legacy mode?
>>> I am fine with that if we all agree on that.
>>
>> Why is a mount option needed? I think we should avoid requiring a remount
>> unless required and I would like to understand why it is required here.
>>
>> Peter: could you please elaborate what you mean with it makes it more
>> difficult for the FS code to generically manage monitor assignment?
>>
>> Why would user space be required to recreate all control and monitor
>> groups if wanting to change how memory bandwidth monitoring is done?
> 
> I was looking at this more from the perspective of whether it's
> necessary to support the live transition of the groups' configuration
> back and forth between programming models.  I find it very unlikely
> for the userspace controller software to change its mind about the
> programming model for monitoring in a running system, so I thought
> this would be in the same category as choosing at mount time whether
> or not to use CDP or the MBA software controller.

This seems reasonable to me if only considering ABMC and legacy. When
also taking into account soft-RMID it is no longer obvious to me. I do
still have an impression that the soft-RMID solution impacts context switch
duration so I am considering the scenario where user space may want to
use soft-RMID for portions of time to get an idea of workload behavior and
then dynamically move to less accurate measurements to not impact the
workloads all the time.

In this case perhaps more like how user space can dynamically change power
saving mode based on requirements of responsiveness etc.


> Also, in the software implementation of monitor assignment for older
> AMD processors, which is based on allocating a subset of RMIDs, I'm
> concerned that the context switch handler would want to read the
> monitors associated with the incoming thread's current group to
> determine whether it should use one of the tracked RMIDs. I believe it
> would be cleaner if the lifetime of the generic monitor-tracking
> structures would last until the static branches gating
> __resctrl_sched_in() could be disabled.

Yes, this falls under the umbrella of needing to understand the impact
of switching between mechanisms that is not obvious to me.

> 
>>
>> From this implementation it has been difficult to understand the impact
>> of switching between ABMC and legacy.
> 
> I'll see if there's a good way to share my software monitor assignment
> prototype so it's clearer how the user interface would interact with
> diverse implementations. Unfortunately, it's difficult to see the
> required abstraction boundaries without the fs/resctrl refactoring
> changes[1] applied. It would also require my changes[2] for reading a
> thread's RMID from the FS structures to prevent monitor assignments
> from forcing an update of all task_structs in the system.
> 
> -Peter
> 
> [1] https://lore.kernel.org/lkml/20240426150537.8094-1-Dave.Martin@arm.com/
> [2] https://lore.kernel.org/lkml/20240325172707.73966-1-peternewman@google.com/

  parent reply	other threads:[~2024-05-03 21:15 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29  1:06 [RFC PATCH v3 00/17] x86/resctrl : Support AMD Assignable Bandwidth Monitoring Counters (ABMC) Babu Moger
2024-03-29  1:06 ` [RFC PATCH v3 01/17] x86/resctrl: Add support for " Babu Moger
2024-05-03 23:25   ` Reinette Chatre
2024-05-06 17:57     ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 02/17] x86/resctrl: Add ABMC feature in the command line options Babu Moger
2024-03-29  1:06 ` [RFC PATCH v3 03/17] x86/resctrl: Detect Assignable Bandwidth Monitoring feature details Babu Moger
2024-05-03 23:26   ` Reinette Chatre
2024-05-06 19:09     ` Moger, Babu
2024-05-07 20:27       ` Reinette Chatre
2024-05-09 22:34         ` Moger, Babu
2024-05-10  3:18           ` Reinette Chatre
2024-05-10 17:01             ` Moger, Babu
2024-05-10 18:34               ` Reinette Chatre
2024-05-11  1:40                 ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 04/17] x86/resctrl: Introduce resctrl_file_fflags_init Babu Moger
2024-05-03 23:26   ` Reinette Chatre
2024-05-06 20:23     ` Moger, Babu
2024-05-07 20:27       ` Reinette Chatre
2024-05-10  0:23         ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 05/17] x86/resctrl: Introduce the interface to display the assignment state Babu Moger
2024-05-03 23:28   ` Reinette Chatre
2024-05-07 16:28     ` Moger, Babu
2024-05-07 20:32       ` Reinette Chatre
2024-03-29  1:06 ` [RFC PATCH v3 06/17] x86/resctrl: Introduce interface to display number of ABMC counters Babu Moger
2024-03-29  1:06 ` [RFC PATCH v3 07/17] x86/resctrl: Add support to enable/disable ABMC feature Babu Moger
2024-04-04  0:30   ` Peter Newman
2024-04-04 15:16     ` Moger, Babu
2024-04-04 17:36       ` Peter Newman
2024-04-04 18:35         ` Moger, Babu
2024-04-04 18:43     ` Reinette Chatre
2024-04-04 19:01       ` Peter Newman
2024-05-16 20:03     ` Moger, Babu
2024-05-03 23:30   ` Reinette Chatre
2024-05-07 19:12     ` Moger, Babu
2024-05-07 20:32       ` Reinette Chatre
2024-05-09 21:45         ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 08/17] x86/resctrl: Initialize assignable counters bitmap Babu Moger
2024-05-03 23:31   ` Reinette Chatre
2024-05-07 20:03     ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 09/17] x86/resctrl: Introduce assign state for the mon group Babu Moger
2024-04-16 18:52   ` Peter Newman
2024-04-16 19:52     ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 10/17] x86/resctrl: Add data structures for ABMC assignment Babu Moger
2024-05-03 23:32   ` Reinette Chatre
2024-05-07 20:40     ` Moger, Babu
2024-05-07 23:06       ` Reinette Chatre
2024-05-10  0:28         ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 11/17] x86/resctrl: Introduce mbm_total_cfg and mbm_local_cfg Babu Moger
2024-05-03 23:33   ` Reinette Chatre
2024-05-08 15:57     ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 12/17] x86/resctrl: Add the functionality to assign the RMID Babu Moger
2024-05-03 23:33   ` Reinette Chatre
2024-05-08 17:40     ` Moger, Babu
2024-03-29  1:06 ` [RFC PATCH v3 13/17] x86/resctrl: Add the functionality to unassign " Babu Moger
2024-03-29  1:06 ` [RFC PATCH v3 14/17] x86/resctrl: Enable ABMC by default on resctrl mount Babu Moger
2024-03-29  1:06 ` [RFC PATCH v3 15/17] x86/resctrl: Introduce the interface switch between ABMC and legacy_mbm Babu Moger
2024-03-29  1:06 ` [RFC PATCH v3 16/17] x86/resctrl: Introduce interface to list assignment states of all the groups Babu Moger
2024-03-29  1:06 ` [RFC PATCH v3 17/17] x86/resctrl: Introduce interface to modify assignment states of " Babu Moger
2024-04-17 17:45   ` Peter Newman
2024-04-17 19:39     ` Moger, Babu
2024-04-17 20:56       ` Peter Newman
2024-04-17 22:52         ` Moger, Babu
2024-05-02 23:00           ` Reinette Chatre
2024-05-03 16:14             ` Moger, Babu
2024-05-03 21:16               ` Reinette Chatre
2024-05-06 18:09                 ` Moger, Babu
2024-05-02 16:21   ` Dave Martin
2024-05-02 17:52     ` Reinette Chatre
2024-05-02 18:11       ` Moger, Babu
2024-05-03 14:53       ` Dave Martin
2024-05-03 21:15         ` Reinette Chatre
2024-04-04 19:08 ` [RFC PATCH v3 00/17] x86/resctrl : Support AMD Assignable Bandwidth Monitoring Counters (ABMC) Peter Newman
2024-04-04 20:02   ` Moger, Babu
2024-04-22 16:34     ` Dave Martin
2024-04-22 20:44       ` Moger, Babu
2024-04-23 12:37         ` Dave Martin
2024-04-24  4:15           ` Reinette Chatre
2024-04-24 14:16             ` Dave Martin
2024-04-24 19:10               ` Moger, Babu
2024-04-22 16:33 ` Dave Martin
2024-04-22 18:23   ` Peter Newman
2024-04-23 12:38     ` Dave Martin
2024-04-23 15:43       ` Moger, Babu
2024-04-23 16:17         ` Dave Martin
2024-05-01 17:48 ` Peter Newman
2024-05-02 16:25   ` Moger, Babu
2024-05-02 17:50     ` Peter Newman
2024-05-02 20:14       ` Moger, Babu
2024-05-02 23:21         ` Reinette Chatre
2024-05-03  0:57           ` Peter Newman
2024-05-03 20:44             ` Moger, Babu
2024-05-03 21:00               ` Peter Newman
2024-05-03 21:15                 ` Reinette Chatre
2024-05-17 21:51                   ` Peter Newman
2024-05-20 14:25                     ` Moger, Babu
2024-05-20 16:00                       ` Peter Newman
2024-05-20 18:03                         ` Moger, Babu
2024-05-10  0:57               ` Moger, Babu
2024-05-10  2:47                 ` Reinette Chatre
2024-05-03 21:14             ` Reinette Chatre [this message]
2024-05-03 23:24 ` Reinette Chatre
2024-05-06 17:18   ` Moger, Babu
2024-05-07 20:26     ` Reinette Chatre
2024-05-08 20:07       ` Moger, Babu
2024-05-08 20:41         ` Reinette Chatre
2024-05-08 23:29           ` Moger, Babu
2024-05-09 18:07             ` Reinette Chatre
2024-05-09 20:34               ` Moger, Babu

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=ea56c630-80f4-4564-beb3-2b61e810a558@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=daniel.sneddon@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=eranian@google.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=james.morse@arm.com \
    --cc=jithu.joseph@intel.com \
    --cc=jmattson@google.com \
    --cc=jpoimboe@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=kan.liang@linux.intel.com \
    --cc=kim.phillips@amd.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=leitao@debian.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peternewman@google.com \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=sandipan.das@amd.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=x86@kernel.org \
    --cc=yanjiewtw@gmail.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