[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALPaoChcra+qJd9ETQT+nZ17ahH0RCCarjuT3jn8EyzV2HyCbw@mail.gmail.com>
Date: Thu, 1 Jun 2023 16:45:27 +0200
From: Peter Newman <peternewman@...gle.com>
To: Reinette Chatre <reinette.chatre@...el.com>
Cc: Fenghua Yu <fenghua.yu@...el.com>, Babu Moger <babu.moger@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Stephane Eranian <eranian@...gle.com>,
James Morse <james.morse@....com>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v1 3/9] x86/resctrl: Add resctrl_mbm_flush_cpu() to
collect CPUs' MBM events
Hi Reinette,
On Thu, May 11, 2023 at 11:37 PM Reinette Chatre
<reinette.chatre@...el.com> wrote:
> On 4/21/2023 7:17 AM, Peter Newman wrote:
> > + /* Count bandwidth after the first successful counter read. */
> > + if (counter->initialized) {
> > + /* Assume that mbm_update() will prevent double-overflows. */
> > + if (val != counter->prev_bytes)
> > + atomic64_add(val - counter->prev_bytes,
> > + &m->soft_rmid_bytes);
> > + } else {
> > + counter->initialized = true;
> > + }
> > +
> > + counter->prev_bytes = val;
>
> I notice a lot of similarities between the above and the software controller,
> see mbm_bw_count().
I see the "a=now(); a-b; b=a;" and the not handling overflow parts
being similar, but the use of the initialized flag seems quite
different from delta_comp.
Also mbm_state is on the arch-independent side and the new code is
going to the arch-dependent side, so it wouldn't be convenient to try
to use the mbm_bw structures for this.
>From this, I don't think trying to reuse this is worth it unless you
have other suggestions.
-Peter
Powered by blists - more mailing lists