Re: [PATCH v3] mm/khugepaged: replace mutex_lock/mutex_unlock usage with guard macro

From: Andrew Morton

Date: Fri Jul 31 2026 - 14:35:42 EST


On Fri, 31 Jul 2026 11:33:47 +0100 Pedro Falcato <pfalcato@xxxxxxx> wrote:

> On Thu, Jul 30, 2026 at 10:47:24PM +0200, Jakov Novak wrote:
> > Currently, khugepaged locks the khugepaged_mutex in two functions:
> > start_stop_khugepaged and khugepaged_min_free_kbytes_update. Remove
> > mutex_lock/mutex_unlock usage in these functions and replace it with the
> > guard macro. This makes the code more readable (removing a goto statement)
> > and makes it harder to introduce bugs in the future.
> > No functional changes introduced.
> >
> > Signed-off-by: Jakov Novak <jakovnovak30@xxxxxxxxx>
> > Reviewed-by: Dev Jain <dev.jain@xxxxxxx>
> > Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
> > Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
>
> Hmm, did Andrew actually give this R-b tag out? I can't find it on-list.

I don't think so. Hallucination ;)

I do sometimes sneak in an offlist R-b when I'm looking at things but
I'm pretty inconsistent and lazy about it.

<looks at it again>

Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>