mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Tony Luck <tony.luck@intel.com>, Peter Newman <peternewman@google.com>
Cc: <fenghua.yu@intel.com>, <babu.moger@amd.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <eranian@google.com>,
	<hpa@zytor.com>, <james.morse@arm.com>,
	<linux-kernel@vger.kernel.org>, <mingo@redhat.com>,
	<nert.pinx@gmail.com>, <tan.shaopeng@fujitsu.com>,
	<tglx@linutronix.de>, <x86@kernel.org>
Subject: Re: [PATCH v2 2/2] x86/resctrl: Don't workqueue local event counter reads
Date: Thu, 7 Nov 2024 11:15:17 -0800	[thread overview]
Message-ID: <034d8377-6276-417a-983b-1af4617d60ca@intel.com> (raw)
In-Reply-To: <ZyzxbhHQptbktfGH@agluck-desk3>

Hi Tony,

On 11/7/24 8:57 AM, Tony Luck wrote:
> On Thu, Nov 07, 2024 at 03:26:11PM +0100, Peter Newman wrote:
>> On Thu, Nov 7, 2024 at 12:01 PM Peter Newman <peternewman@google.com> wrote:
>>>
>>> Hi Reinette,
>>>
>>> On Thu, Nov 7, 2024 at 2:10 AM Reinette Chatre <reinette.chatre@intel.com> wrote:
>>
>>>> This sounds as though user space is essentially duplicating what the
>>>> MBM overflow handler currently does, which is to run a worker in each domain
>>>> to collect MBM data every second from every RMID for both MBM events.
>>>>
>>>> * What are the requirements of this use case?
>>>
>>> Accurate, per-RMID MBps data, ideally at 1-second resolution if the
>>> overhead can be tolerable.
>>
>> Sorry, forgot about the assignable counters issue...
>>
>> On AMD we'll have to cycle the available event counters through the
>> groups in order to get valid bandwidth counts.
> 
> See below.
> 
>>>> For example,
>>>>         # cat /sys/fs/resctrl/info/L3_MON/mbm_snapshot/mbm_total_bytes_00
>>>>           <rdtgroup nameA> <MBM total count>
>>>>           <rdtgroup nameB> <MBM total count>
>>>>           ...
>>>>
>>>>         # cat /sys/fs/resctrl/info/L3_MON/mbm_snapshot/mbm_total_bytes_01
>>>>           <rdtgroup nameA> <MBM total count>
>>>>           <rdtgroup nameB> <MBM total count>
>>>>           ...
> 
> How about:
> 
> # cat /sys/fs/resctrl/info/L3_MON/mbm_snapshot/mbm_total_bytes_00
> <rdtgroup nameA> <MBM total count> <timestamp> <generation>
> <rdtgroup nameB> <MBM total count> <timestamp> <generation>
> ...
>>>>
> # cat /sys/fs/resctrl/info/L3_MON/mbm_snapshot/mbm_total_bytes_01
> <rdtgroup nameA> <MBM total count> <timestamp> <generation>
> <rdtgroup nameB> <MBM total count> <timestamp> <generation>
> ...
> 
> Where <timestamp> tracks when this sample was captured. And
> <generation> is an integer that is incremented when data
> for this event is lost (e.g. due to ABMC counter re-assignment).

It is not obvious to me how resctrl can provide a reliable
"generation" value.

 
> Then a monitor application can compute bandwidth for each
> group by periodic sampling and for each group:
> 
> 	if (thisgeneration == lastgeneration) {
> 		bw = (thiscount - lastcount) / (thistimestanp - lasttimestamp);

If user space needs visibility into these internals then we could also
consider adding a trace event that logs the timestamped data right when it
is queried by the overflow handler.

Reinette

  reply	other threads:[~2024-11-07 19:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 15:43 [PATCH v2 1/2] selftests/resctrl: fastcat for benchmarking " Peter Newman
2024-11-06 15:43 ` [PATCH v2 2/2] x86/resctrl: Don't workqueue local event " Peter Newman
2024-11-07  1:10   ` Reinette Chatre
2024-11-07 11:01     ` Peter Newman
2024-11-07 14:26       ` Peter Newman
2024-11-07 16:57         ` Tony Luck
2024-11-07 19:15           ` Reinette Chatre [this message]
2024-11-07 20:58             ` Luck, Tony
2024-11-07 22:03               ` Reinette Chatre
2024-11-07 22:14                 ` Luck, Tony
2024-11-07 22:46                   ` Reinette Chatre
2024-11-07 23:30                     ` Luck, Tony
2024-11-08  0:21                       ` Reinette Chatre
2024-11-07 19:14         ` Reinette Chatre
2024-11-13 13:28           ` Peter Newman
2024-11-14  5:40             ` Reinette Chatre
2024-11-14 10:18               ` Peter Newman

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=034d8377-6276-417a-983b-1af4617d60ca@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=eranian@google.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nert.pinx@gmail.com \
    --cc=peternewman@google.com \
    --cc=tan.shaopeng@fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®