Re: [PATCH v1 30/31] x86/resctrl: Move the filesystem bits to headers visible to fs/resctrl

From: Dave Martin
Date: Thu Apr 11 2024 - 10:28:05 EST


On Thu, Apr 04, 2024 at 07:43:03AM +0000, Shaopeng Tan (Fujitsu) wrote:
> Hello James
>
> > Once the filesystem parts of resctrl move to fs/resctrl, it cannot rely on
> > definitions in x86's internal.h.
> >
> > Move definitions in internal.h that need to be shared between the filesystem
> > and architecture code to header files that fs/resctrl can include.
> >
> > Doing this separately means the filesystem code only moves between files of
> > the same name, instead of having these changes mixed in too.
> >
> > Signed-off-by: James Morse <james.morse@xxxxxxx>
> > ---
> > arch/x86/include/asm/resctrl.h | 3 +++
> > arch/x86/kernel/cpu/resctrl/core.c | 5 ++++
> > arch/x86/kernel/cpu/resctrl/internal.h | 36 --------------------------
> > include/linux/resctrl.h | 3 +++
> > include/linux/resctrl_types.h | 30
> > +++++++++++++++++++++
> > 5 files changed, 41 insertions(+), 36 deletions(-)

[...]

> > diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index
> > f786ffceeda3..00cc0457af50 100644
> > --- a/include/linux/resctrl.h
> > +++ b/include/linux/resctrl.h
> > @@ -41,6 +41,9 @@ int proc_resctrl_show(struct seq_file *m,
> > */
> > #define RESCTRL_MAX_CBM 32
> >
> > +extern unsigned int resctrl_rmid_realloc_limit; extern unsigned int
> > +resctrl_rmid_realloc_threshold;
> > +

[FYI, your mailer or editor seems to have messed this patch up a bit in
your reply...]

> These two variables has been defined.
> 44 extern unsigned int resctrl_rmid_realloc_limit;
> 45 extern unsigned int resctrl_rmid_realloc_threshold;
> 400 extern unsigned int resctrl_rmid_realloc_threshold;
> 401 extern unsigned int resctrl_rmid_realloc_limit;
>
> Best regards,
> Shaopeng TAN

[...]

Strange. This looks unintentional and there don't seem to be any
relevant #ifdefs or references to these variables in the header that
might justify reordering these declarations.

I'll propose to James that the addition of these duplicates be reverted
out, so long as it doesn't break anything.

Cheers
---Dave