Messages in this thread | ![/](/images/icornerl.gif) | | Date | Tue, 20 Dec 2022 12:58:19 -0600 | Subject | Re: [PATCH v9 10/13] x86/resctrl: Add sysfs interface to write mbm_total_bytes_config | From | "Moger, Babu" <> |
| |
Hi Reinette,
On 12/20/22 11:32, Reinette Chatre wrote: > Hi Babu, > > On 12/19/2022 11:28 AM, Moger, Babu wrote: >> [AMD Official Use Only - General] >> >> Hi Reinette, >> >>> -----Original Message----- >>> From: Reinette Chatre <reinette.chatre@intel.com> >>> Sent: Thursday, December 15, 2022 12:25 PM >>> To: Moger, Babu <Babu.Moger@amd.com>; corbet@lwn.net; >>> tglx@linutronix.de; mingo@redhat.com; bp@alien8.de >>> Cc: fenghua.yu@intel.com; dave.hansen@linux.intel.com; x86@kernel.org; >>> hpa@zytor.com; paulmck@kernel.org; akpm@linux-foundation.org; >>> quic_neeraju@quicinc.com; rdunlap@infradead.org; >>> damien.lemoal@opensource.wdc.com; songmuchun@bytedance.com; >>> peterz@infradead.org; jpoimboe@kernel.org; pbonzini@redhat.com; >>> chang.seok.bae@intel.com; pawan.kumar.gupta@linux.intel.com; >>> jmattson@google.com; daniel.sneddon@linux.intel.com; Das1, Sandipan >>> <Sandipan.Das@amd.com>; tony.luck@intel.com; james.morse@arm.com; >>> linux-doc@vger.kernel.org; linux-kernel@vger.kernel.org; >>> bagasdotme@gmail.com; eranian@google.com; christophe.leroy@csgroup.eu; >>> jarkko@kernel.org; adrian.hunter@intel.com; quic_jiles@quicinc.com; >>> peternewman@google.com >>> Subject: Re: [PATCH v9 10/13] x86/resctrl: Add sysfs interface to write >>> mbm_total_bytes_config >>> >>> Hi Babu, >>> >>> On 12/1/2022 7:37 AM, Babu Moger wrote: > ... > >>>> + /* >>>> + * When an Event Configuration is changed, the bandwidth counters >>>> + * for all RMIDs and Events will be cleared by the hardware. The >>>> + * hardware also sets MSR_IA32_QM_CTR.Unavailable (bit 62) for >>>> + * every RMID on the next read to any event for every RMID. >>>> + * Subsequent reads will have MSR_IA32_QM_CTR.Unavailable (bit 62) >>>> + * cleared while it is tracked by the hardware. Clear the >>>> + * mbm_local and mbm_total counts for all the RMIDs. >>>> + */ >>>> + resctrl_arch_reset_rmid_all(r, d); >>> If I understand correctly the expectation is that when user space read counters >>> (via mon_data files) right after the configuration was changed then this read >>> will return "Unavailable" and then the next read will return data. >>> >>> If this is the case then I think a snippet about this user experience would be >>> helpful to add to the documentation. >> Ok. How about this in the documentation? >> >> "When an event configuration is changed, the bandwidth counters for all the RMIDs and the events will be cleared for that domain. >> The next read for every RMID will report "Unavailable" and subsequent reads will report the valid value." >> >> > Thinking about this more ... why are the counters for all eventids cleared > when only one eventid's configuration is changed?
Its because of the way U-Bit tracking is implemented. The U-bit is tracked per RMID basis, not on a Per-Event + Per RMID basis. Therefore, resetting the U-Bit for 1 will reset it for both.
This is what I got from h/w team.
Thanks
Babu
> > Reinette > > -- Thanks Babu Moger
| ![\](/images/icornerr.gif) |