Re: [PATCH v5 2/4] mm: huge_memory: refactor anon_enabled_store() with change_anon_orders()
From: Breno Leitao
Date: Wed Mar 11 2026 - 05:43:27 EST
On Wed, Mar 11, 2026 at 12:52:02PM +0800, Lance Yang wrote:
> On 2026/3/11 11:12, Wei Yang wrote:
> > On Tue, Mar 10, 2026 at 10:57:08AM -0700, Breno Leitao wrote:
> > > +enum anon_enabled_mode {
> > > + ANON_ENABLED_ALWAYS = 0,
> > > + ANON_ENABLED_MADVISE = 1,
> > > + ANON_ENABLED_INHERIT = 2,
> > > + ANON_ENABLED_NEVER = 3,
> > > +};
> > > +
> > > +static const char * const anon_enabled_mode_strings[] = {
> > > + [ANON_ENABLED_ALWAYS] = "always",
> > > + [ANON_ENABLED_MADVISE] = "madvise",
> > > + [ANON_ENABLED_INHERIT] = "inherit",
> > > + [ANON_ENABLED_NEVER] = "never",
> > > +};
> > > +
> >
> > Just one trivial thing, maybe keep the sequence as the sysfs output?
> >
> > Currently the output of /sys/kernel/transparent_hugepage/hugepages-xxxkB is
> >
> > always inherit madvise [never]
> >
> > But no strong opinion on this.
>
> Yeah, keeping the enum order consistent with the sysfs output looks sensible
> :)
Good point, I'll adjust the order to match the sysfs output and send out
a new version.
Thanks for the feedback!
--breno