Re: [RFC RFC PATCH] mm: convert VM flags from macros to enum
From: David Hildenbrand
Date: Mon Oct 13 2025 - 07:12:26 EST
On 13.10.25 13:04, Lorenzo Stoakes wrote:
On Sat, Oct 11, 2025 at 05:30:52PM +0800, Ye Liu wrote:
From: Ye Liu <liuye@xxxxxxxxxx>
Hello MM maintainers and drgn community,
This RFC proposes to convert VM_* flags from #define macros to enum
vm_flags. The motivation comes from recent drgn development where we
encountered difficulties in implementing VM flag parsing due to the
current macro-based approach.
This isn't going to work sorry, it's not valid to have flag values as an enum
I don't follow, can you elaborate? IIRC, the compiler will use an integer type to back the enum that will fit all values.
(they're distinct) and also - importantly - I'm going to be making significant
changes to VMA flags soon (to allow us to have arbitrary number of VMA flags on
_all_ architectures as recently done with my series doing something similar with
mm flags).
I guess this patch should not really make a big difference regarding your upcoming plans?
I do hate the enum stuff to make these tools happy, though :)
--
Cheers
David / dhildenb