[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9hPuMV5n_FY02MM@agluck-desk3>
Date: Mon, 17 Mar 2025 09:37:12 -0700
From: "Luck, Tony" <tony.luck@...el.com>
To: "Moger, Babu" <babu.moger@....com>
Cc: Fenghua Yu <fenghuay@...dia.com>,
Reinette Chatre <reinette.chatre@...el.com>,
Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>,
Peter Newman <peternewman@...gle.com>,
James Morse <james.morse@....com>,
Drew Fustini <dfustini@...libre.com>,
Dave Martin <Dave.Martin@....com>, linux-kernel@...r.kernel.org,
patches@...ts.linux.dev
Subject: Re: [PATCH] x86/resctrl: Refactor to make adding extra MBM events
easy
Hi Babu,
Thanks for taking a look.
On Mon, Mar 17, 2025 at 09:54:59AM -0500, Moger, Babu wrote:
> > static void mbm_update(struct rdt_resource *r, struct rdt_mon_domain *d,
> > u32 closid, u32 rmid)
> > {
> > + int evt;
> > +
> > /*
> > * This is protected from concurrent reads from user as both
> > * the user and overflow handler hold the global mutex.
> > */
> > - if (resctrl_arch_is_mbm_total_enabled())
> > - mbm_update_one_event(r, d, closid, rmid, QOS_L3_MBM_TOTAL_EVENT_ID);
> > -
> > - if (resctrl_arch_is_mbm_local_enabled())
> > - mbm_update_one_event(r, d, closid, rmid, QOS_L3_MBM_LOCAL_EVENT_ID);
> > + for_each_set_bit(evt, &rdt_mon_features, sizeof(rdt_mon_features))
> > + mbm_update_one_event(r, d, closid, rmid, evt);
>
> You need a check resctrl_arch_is_mbm_event() here.
Right. This is definitely broken. Needs that check.
> Will that be reason for your hang issue?
Might have. But it isn't my only problem. After fixing this my
kernel dies on a deref NULL.
> > @@ -1075,20 +1062,37 @@ static void dom_data_exit(struct rdt_resource *r)
> > mutex_unlock(&rdtgroup_mutex);
> > }
> >
> > -static struct mon_evt llc_occupancy_event = {
> > - .name = "llc_occupancy",
> > - .evtid = QOS_L3_OCCUP_EVENT_ID,
> > +static struct mon_evt all_events[] = {
>
> There is one empty event here. You may need to make that clear.
Yes. I went with "some wasted space" for code simplicity just
using the bit numbers in rdt_mon_features to index this array.
Also applies to the mbm_states[] field in rdt_mon_domain and
the arch_mbm_states[] array in rdt_hw_mon_domain. The wasted
space could be reclaimed with some macros to convert from
bit numbers to array indices should this patch ever be
considered for inclusion.
-Tony
Powered by blists - more mailing lists