Re: [PATCH] mm/mempolicy: Fix weighted interleave auto sysfs name

From: Joshua Hahn

Date: Tue Apr 07 2026 - 13:27:34 EST


On Tue, 7 Apr 2026 13:09:04 -0400 Gregory Price <gourry@xxxxxxxxxx> wrote:

> On Tue, Apr 07, 2026 at 07:14:14AM -0700, Joshua Hahn wrote:
> > The __ATTR macro is a utility that makes defining kobj_attributes easier
> > by stringfying the name, verifying the mode, and setting the show/store
> > fields in a single initializer. It takes a raw token as the first value,
> > rather than a string, so that __ATTR family macros like __ATTR_RW can
> > token-paste it for inferring the _show / _store function names.
> >
> > Commit e341f9c3c841 ("mm/mempolicy: Weighted Interleave Auto-tuning")
> > used the __ATTR macro to define the "auto" sysfs for weighted
> > interleave. A few months later, commit 2fb6915fa22d ("compiler_types.h:
> > add "auto" as a macro for "__auto_type"") introduced a #define macro
> > which expanded auto into __auto_type.
> >
>

Hello Gregory, thanks for reviewing my patch!!

> Well that's really unfortunately.
>
> Is this really the only "auto" in the entire sysfs structure?

Thankfully, it seems so:

$ rg "__ATTR\(auto"

mm/mempolicy.c
3786: __ATTR(auto, 0664, weighted_interleave_auto_show,

arch/powerpc/platforms/pseries/power.c
44: __ATTR(auto_poweron, 0644, auto_poweron_show, auto_poweron_store);

Although maybe it is more valuable to check any __ATTR family macro
for a macro as the first parameter. In hindsight, I should have been more
wary of passing a keyword as a token.

[...snip...]

> > Signed-off-by: Joshua Hahn <joshua.hahnjy@xxxxxxxxx>
>
> Maybe -
>
> Fixes: 2fb6915fa22d ("compiler_types.h: add "auto" as a macro for "__auto_type"")

I thought about adding a Fixes tag, decided against it because it's
purely cosmetic.

... but now that I think about it, I think this could break some workflows
for users who have automated writing to the auto sysfs file.

Maybe I should add a fixes tag for the patch that introduced the
sysfs file instead? That is,

Fixes: e341f9c3c841 ("mm/mempolicy: Weighted Interleave Auto-tuning")

> Reviewed-by: Gregory Price <gourry@xxxxxxxxxx>

Thanks again, Gregory!! I hope you have a great day : -)
Joshua