Re: [PATCH v9 10/12] fs/resctrl: Call architecture hooks for every mount/unmount
From: Luck, Tony
Date: Fri Jul 10 2026 - 17:01:55 EST
On Wed, Jul 08, 2026 at 03:53:20PM -0700, Reinette Chatre wrote:
> Hi Tony,
>
> On 7/1/26 2:35 PM, Tony Luck wrote:
> > The intel_pmt module should only be pinned while the resctrl file system
> > is mounted.
> >
> > Add hooks for every mount/unmount of the resctrl file system so that
> > architecture code can increment the intel_pmt module reference count on
> > mount and decrement on unmount.
> >
> > Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> > ---
>
> > @@ -3168,6 +3167,8 @@ static void resctrl_unmount(void)
> > resctrl_mounted = false;
> > mutex_unlock(&rdtgroup_mutex);
> > cpus_read_unlock();
> > +
> > + resctrl_arch_unmount();
> > }
> >
> > static int rdt_get_tree(struct fs_context *fc)
> > @@ -3179,7 +3180,7 @@ static int rdt_get_tree(struct fs_context *fc)
> > struct rdt_resource *r;
> > int ret;
> >
> > - DO_ONCE_SLEEPABLE(resctrl_arch_pre_mount);
> > + resctrl_arch_pre_mount();
> >
> > cpus_read_lock();
> > mutex_lock(&rdtgroup_mutex);
> > @@ -3318,6 +3319,9 @@ static int rdt_get_tree(struct fs_context *fc)
> > out:
> > mutex_unlock(&rdtgroup_mutex);
> > cpus_read_unlock();
> > +
> > + resctrl_arch_unmount();
> > +
> > return ret;
> > }
> >
>
> rdt_get_tree() jumps to "out" if resctrl is already mounted - in this scenario
> resctrl fs is mounted and the telemetry events exposed to user space. Above would
> cause telemetry to be yanked from underneath an existing mount?
Correct. I think I just need to make intel_aet_unmount() return a "bool"
so that the early return when resctrl is mounted knows to skip tearing
down the domains etc.
>
> Reinette
-Tony