Re: [PATCH v2 3/3] mm: huge_memory: refactor enabled_store() with change_enabled()

From: Breno Leitao

Date: Fri Mar 06 2026 - 11:00:11 EST


On Fri, Mar 06, 2026 at 11:39:28AM +0000, Lorenzo Stoakes (Oracle) wrote:
> On Thu, Mar 05, 2026 at 06:04:55AM -0800, Breno Leitao wrote:
> > + mode = sysfs_match_string(enabled_mode_strings, buf);
> > + if (mode < 0 || mode == ENABLED_INHERIT)
> > + return -EINVAL;
>
> The mode == ENABLED_INHERIT check is weird, it reads like 'oh a user CAN specify
> this, but if they do we error out', but in reality
> /sys/kernel/mm/transparent_hugepage/enabled explicitly outputs only always,
> inherit, maddvise.
>
> So, even though it's duplicative, I think it's probably saner to have:

Agree. That would be a better approach.

> With that fixed, feel free to add:
>
> Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@xxxxxxxxxx>

Ack, thanks for the review,
--breno