Re: [PATCH 02/10] mm: convert core mm to mm_flags_*() accessors

Andrew Morton
2025-08-12T22:52:33Z

On Tue, 12 Aug 2025 16:44:11 +0100 Lorenzo Stoakes <lorenzo.stoakes@oracle.com> wrote:

> As part of the effort to move to mm->flags becoming a bitmap field, convert
> existing users to making use of the mm_flags_*() accessors which will, when
> the conversion is complete, be the only means of accessing mm_struct flags.
>
> This will result in the debug output being that of a bitmap output, which
> will result in a minor change here, but since this is for debug only, this
> should have no bearing.
>
> Otherwise, no functional changes intended.

Code is obviously buggy - you cannot possibly have tested it.

--- a/mm/khugepaged.c~mm-convert-core-mm-to-mm_flags_-accessors-fix
+++ a/mm/khugepaged.c
@@ -1459,7 +1459,7 @@ static void collect_mm_slot(struct khuge
/*
* Not strictly needed because the mm exited already.
*
- * mm_clear(mm, MMF_VM_HUGEPAGE);
+ * mm_flags_clear(MMF_VM_HUGEPAGE, mm);
*/

/* khugepaged_mm_lock actually not necessary for the below */

there, fixed.

I applied the series to mm-new, thanks. Emails were suppressed out of
kindness.