linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] mm: redefine VM_* flag constants with BIT()
@ 2025-10-02  7:52 Jakub Acs
  2025-10-02  7:54 ` David Hildenbrand
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jakub Acs @ 2025-10-02  7:52 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: acsjakub, Andrew Morton, David Hildenbrand, Xu Xin,
	Chengming Zhou, Peter Xu, Axel Rasmussen, linux-mm, linux-kernel

Make VM_* flag constant definitions consistent - unify all to use BIT()
macro.

We have previously changed VM_MERGEABLE in a separate bugfix. This is a
follow-up to make all the VM_* flag constant definitions consistent, as
suggested by David in [1].

[1]: https://lore.kernel.org/all/85f852f9-8577-4230-adc7-c52e7f479454@redhat.com/

Signed-off-by: Jakub Acs <acsjakub@amazon.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Xu Xin <xu.xin16@zte.com.cn>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Peter Xu <peterx@redhat.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
---
v3 -> v4:
 - fix VM_MAYOVERLAY and VM_PFNMAP definitions
 - send outside the series

This depends on the following patch:
https://lore.kernel.org/all/20251001090353.57523-2-acsjakub@amazon.de/

v3: https://lore.kernel.org/all/20251001090353.57523-3-acsjakub@amazon.de/

 include/linux/mm.h | 66 +++++++++++++++++++++++-----------------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index c6794d0e24eb..cb33f967d327 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -246,56 +246,56 @@ extern unsigned int kobjsize(const void *objp);
  * vm_flags in vm_area_struct, see mm_types.h.
  * When changing, update also include/trace/events/mmflags.h
  */
-#define VM_NONE		0x00000000
+#define VM_NONE		0
 
-#define VM_READ		0x00000001	/* currently active flags */
-#define VM_WRITE	0x00000002
-#define VM_EXEC		0x00000004
-#define VM_SHARED	0x00000008
+#define VM_READ		BIT(0)		/* currently active flags */
+#define VM_WRITE	BIT(1)
+#define VM_EXEC		BIT(2)
+#define VM_SHARED	BIT(3)
 
 /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
-#define VM_MAYREAD	0x00000010	/* limits for mprotect() etc */
-#define VM_MAYWRITE	0x00000020
-#define VM_MAYEXEC	0x00000040
-#define VM_MAYSHARE	0x00000080
+#define VM_MAYREAD	BIT(4)		/* limits for mprotect() etc */
+#define VM_MAYWRITE	BIT(5)
+#define VM_MAYEXEC	BIT(6)
+#define VM_MAYSHARE	BIT(7)
 
-#define VM_GROWSDOWN	0x00000100	/* general info on the segment */
+#define VM_GROWSDOWN	BIT(8)		/* general info on the segment */
 #ifdef CONFIG_MMU
-#define VM_UFFD_MISSING	0x00000200	/* missing pages tracking */
+#define VM_UFFD_MISSING	BIT(9)		/* missing pages tracking */
 #else /* CONFIG_MMU */
-#define VM_MAYOVERLAY	0x00000200	/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
+#define VM_MAYOVERLAY	BIT(9)		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
 #define VM_UFFD_MISSING	0
 #endif /* CONFIG_MMU */
-#define VM_PFNMAP	0x00000400	/* Page-ranges managed without "struct page", just pure PFN */
-#define VM_UFFD_WP	0x00001000	/* wrprotect pages tracking */
+#define VM_PFNMAP	BIT(10)		/* Page-ranges managed without "struct page", just pure PFN */
+#define VM_UFFD_WP	BIT(12)		/* wrprotect pages tracking */
 
-#define VM_LOCKED	0x00002000
-#define VM_IO           0x00004000	/* Memory mapped I/O or similar */
+#define VM_LOCKED	BIT(13)
+#define VM_IO           BIT(14)		/* Memory mapped I/O or similar */
 
 					/* Used by sys_madvise() */
-#define VM_SEQ_READ	0x00008000	/* App will access data sequentially */
-#define VM_RAND_READ	0x00010000	/* App will not benefit from clustered reads */
-
-#define VM_DONTCOPY	0x00020000      /* Do not copy this vma on fork */
-#define VM_DONTEXPAND	0x00040000	/* Cannot expand with mremap() */
-#define VM_LOCKONFAULT	0x00080000	/* Lock the pages covered when they are faulted in */
-#define VM_ACCOUNT	0x00100000	/* Is a VM accounted object */
-#define VM_NORESERVE	0x00200000	/* should the VM suppress accounting */
-#define VM_HUGETLB	0x00400000	/* Huge TLB Page VM */
-#define VM_SYNC		0x00800000	/* Synchronous page faults */
-#define VM_ARCH_1	0x01000000	/* Architecture-specific flag */
-#define VM_WIPEONFORK	0x02000000	/* Wipe VMA contents in child. */
-#define VM_DONTDUMP	0x04000000	/* Do not include in the core dump */
+#define VM_SEQ_READ	BIT(15)		/* App will access data sequentially */
+#define VM_RAND_READ	BIT(16)		/* App will not benefit from clustered reads */
+
+#define VM_DONTCOPY	BIT(17)		/* Do not copy this vma on fork */
+#define VM_DONTEXPAND	BIT(18)		/* Cannot expand with mremap() */
+#define VM_LOCKONFAULT	BIT(19)		/* Lock the pages covered when they are faulted in */
+#define VM_ACCOUNT	BIT(20)		/* Is a VM accounted object */
+#define VM_NORESERVE	BIT(21)		/* should the VM suppress accounting */
+#define VM_HUGETLB	BIT(22)		/* Huge TLB Page VM */
+#define VM_SYNC		BIT(23)		/* Synchronous page faults */
+#define VM_ARCH_1	BIT(24)		/* Architecture-specific flag */
+#define VM_WIPEONFORK	BIT(25)		/* Wipe VMA contents in child. */
+#define VM_DONTDUMP	BIT(26)		/* Do not include in the core dump */
 
 #ifdef CONFIG_MEM_SOFT_DIRTY
-# define VM_SOFTDIRTY	0x08000000	/* Not soft dirty clean area */
+# define VM_SOFTDIRTY	BIT(27)		/* Not soft dirty clean area */
 #else
 # define VM_SOFTDIRTY	0
 #endif
 
-#define VM_MIXEDMAP	0x10000000	/* Can contain "struct page" and pure PFN pages */
-#define VM_HUGEPAGE	0x20000000	/* MADV_HUGEPAGE marked this vma */
-#define VM_NOHUGEPAGE	0x40000000	/* MADV_NOHUGEPAGE marked this vma */
+#define VM_MIXEDMAP	BIT(28)		/* Can contain "struct page" and pure PFN pages */
+#define VM_HUGEPAGE	BIT(29)		/* MADV_HUGEPAGE marked this vma */
+#define VM_NOHUGEPAGE	BIT(30)		/* MADV_NOHUGEPAGE marked this vma */
 #define VM_MERGEABLE	BIT(31)		/* KSM may merge identical pages */
 
 #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
-- 
2.47.3




Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v4] mm: redefine VM_* flag constants with BIT()
  2025-10-02  7:52 [PATCH v4] mm: redefine VM_* flag constants with BIT() Jakub Acs
@ 2025-10-02  7:54 ` David Hildenbrand
  2025-10-02 17:43 ` SeongJae Park
  2025-10-07 16:21 ` [PATCH] mm: use enum for vm_flags Alice Ryhl
  2 siblings, 0 replies; 15+ messages in thread
From: David Hildenbrand @ 2025-10-02  7:54 UTC (permalink / raw)
  To: Jakub Acs, linux-fsdevel
  Cc: Andrew Morton, Xu Xin, Chengming Zhou, Peter Xu, Axel Rasmussen,
	linux-mm, linux-kernel

On 02.10.25 09:52, Jakub Acs wrote:
> Make VM_* flag constant definitions consistent - unify all to use BIT()
> macro.
> 
> We have previously changed VM_MERGEABLE in a separate bugfix. This is a
> follow-up to make all the VM_* flag constant definitions consistent, as
> suggested by David in [1].
> 
> [1]: https://lore.kernel.org/all/85f852f9-8577-4230-adc7-c52e7f479454@redhat.com/
> 
> Signed-off-by: Jakub Acs <acsjakub@amazon.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Xu Xin <xu.xin16@zte.com.cn>
> Cc: Chengming Zhou <chengming.zhou@linux.dev>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Axel Rasmussen <axelrasmussen@google.com>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> ---

LGTM now, thanks!

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers

David / dhildenb


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4] mm: redefine VM_* flag constants with BIT()
  2025-10-02  7:52 [PATCH v4] mm: redefine VM_* flag constants with BIT() Jakub Acs
  2025-10-02  7:54 ` David Hildenbrand
@ 2025-10-02 17:43 ` SeongJae Park
  2025-10-07 16:21 ` [PATCH] mm: use enum for vm_flags Alice Ryhl
  2 siblings, 0 replies; 15+ messages in thread
From: SeongJae Park @ 2025-10-02 17:43 UTC (permalink / raw)
  To: Jakub Acs
  Cc: SeongJae Park, linux-fsdevel, Andrew Morton, David Hildenbrand,
	Xu Xin, Chengming Zhou, Peter Xu, Axel Rasmussen, linux-mm,
	linux-kernel

On Thu, 2 Oct 2025 07:52:02 +0000 Jakub Acs <acsjakub@amazon.de> wrote:

> Make VM_* flag constant definitions consistent - unify all to use BIT()
> macro.
> 
> We have previously changed VM_MERGEABLE in a separate bugfix. This is a
> follow-up to make all the VM_* flag constant definitions consistent, as
> suggested by David in [1].
> 
> [1]: https://lore.kernel.org/all/85f852f9-8577-4230-adc7-c52e7f479454@redhat.com/
> 
> Signed-off-by: Jakub Acs <acsjakub@amazon.de>

Acked-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] mm: use enum for vm_flags
  2025-10-02  7:52 [PATCH v4] mm: redefine VM_* flag constants with BIT() Jakub Acs
  2025-10-02  7:54 ` David Hildenbrand
  2025-10-02 17:43 ` SeongJae Park
@ 2025-10-07 16:21 ` Alice Ryhl
  2025-10-07 17:01   ` Darrick J. Wong
                     ` (4 more replies)
  2 siblings, 5 replies; 15+ messages in thread
From: Alice Ryhl @ 2025-10-07 16:21 UTC (permalink / raw)
  To: acsjakub
  Cc: akpm, axelrasmussen, chengming.zhou, david, linux-fsdevel,
	linux-kernel, linux-mm, peterx, xu.xin16, rust-for-linux,
	Alice Ryhl

The bindgen tool is better able to handle BIT(_) declarations when used
in an enum.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Hi Jakub,

what do you think about modifying the patch like this to use an enum? It
resolves the issues brought up in
	https://lore.kernel.org/all/CAH5fLghTu-Zcm9e3Hy07nNtvB_-hRjojAWDoq-hhBYGE7LPEbQ@mail.gmail.com/

Feel free to squash this patch into your patch.

 include/linux/mm.h              | 90 +++++++++++++++++----------------
 rust/bindings/bindings_helper.h |  1 -
 2 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7916d527f687..69da7ce13e50 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -273,57 +273,58 @@ extern unsigned int kobjsize(const void *objp);
  * vm_flags in vm_area_struct, see mm_types.h.
  * When changing, update also include/trace/events/mmflags.h
  */
-#define VM_NONE		0
+enum {
+	VM_NONE		= 0,
 
-#define VM_READ		BIT(0)		/* currently active flags */
-#define VM_WRITE	BIT(1)
-#define VM_EXEC		BIT(2)
-#define VM_SHARED	BIT(3)
+	VM_READ		= BIT(0),		/* currently active flags */
+	VM_WRITE	= BIT(1),
+	VM_EXEC		= BIT(2),
+	VM_SHARED	= BIT(3),
 
 /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
-#define VM_MAYREAD	BIT(4)		/* limits for mprotect() etc */
-#define VM_MAYWRITE	BIT(5)
-#define VM_MAYEXEC	BIT(6)
-#define VM_MAYSHARE	BIT(7)
+	VM_MAYREAD	= BIT(4),		/* limits for mprotect() etc */
+	VM_MAYWRITE	= BIT(5),
+	VM_MAYEXEC	= BIT(6),
+	VM_MAYSHARE	= BIT(7),
 
-#define VM_GROWSDOWN	BIT(8)		/* general info on the segment */
+	VM_GROWSDOWN	= BIT(8),		/* general info on the segment */
 #ifdef CONFIG_MMU
-#define VM_UFFD_MISSING	BIT(9)		/* missing pages tracking */
+	VM_UFFD_MISSING	= BIT(9),		/* missing pages tracking */
 #else /* CONFIG_MMU */
-#define VM_MAYOVERLAY	BIT(9)		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
+	VM_MAYOVERLAY	= BIT(9),		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
 #define VM_UFFD_MISSING	0
 #endif /* CONFIG_MMU */
-#define VM_PFNMAP	BIT(10)		/* Page-ranges managed without "struct page", just pure PFN */
-#define VM_UFFD_WP	BIT(12)		/* wrprotect pages tracking */
-
-#define VM_LOCKED	BIT(13)
-#define VM_IO           BIT(14)		/* Memory mapped I/O or similar */
-
-					/* Used by sys_madvise() */
-#define VM_SEQ_READ	BIT(15)		/* App will access data sequentially */
-#define VM_RAND_READ	BIT(16)		/* App will not benefit from clustered reads */
-
-#define VM_DONTCOPY	BIT(17)		/* Do not copy this vma on fork */
-#define VM_DONTEXPAND	BIT(18)		/* Cannot expand with mremap() */
-#define VM_LOCKONFAULT	BIT(19)		/* Lock the pages covered when they are faulted in */
-#define VM_ACCOUNT	BIT(20)		/* Is a VM accounted object */
-#define VM_NORESERVE	BIT(21)		/* should the VM suppress accounting */
-#define VM_HUGETLB	BIT(22)		/* Huge TLB Page VM */
-#define VM_SYNC		BIT(23)		/* Synchronous page faults */
-#define VM_ARCH_1	BIT(24)		/* Architecture-specific flag */
-#define VM_WIPEONFORK	BIT(25)		/* Wipe VMA contents in child. */
-#define VM_DONTDUMP	BIT(26)		/* Do not include in the core dump */
+	VM_PFNMAP	= BIT(10),		/* Page-ranges managed without "struct page", just pure PFN */
+	VM_UFFD_WP	= BIT(12),		/* wrprotect pages tracking */
+
+	VM_LOCKED	= BIT(13),
+	VM_IO           = BIT(14),		/* Memory mapped I/O or similar */
+
+						/* Used by sys_madvise() */
+	VM_SEQ_READ	= BIT(15),		/* App will access data sequentially */
+	VM_RAND_READ	= BIT(16),		/* App will not benefit from clustered reads */
+
+	VM_DONTCOPY	= BIT(17),		/* Do not copy this vma on fork */
+	VM_DONTEXPAND	= BIT(18),		/* Cannot expand with mremap() */
+	VM_LOCKONFAULT	= BIT(19),		/* Lock the pages covered when they are faulted in */
+	VM_ACCOUNT	= BIT(20),		/* Is a VM accounted object */
+	VM_NORESERVE	= BIT(21),		/* should the VM suppress accounting */
+	VM_HUGETLB	= BIT(22),		/* Huge TLB Page VM */
+	VM_SYNC		= BIT(23),		/* Synchronous page faults */
+	VM_ARCH_1	= BIT(24),		/* Architecture-specific flag */
+	VM_WIPEONFORK	= BIT(25),		/* Wipe VMA contents in child. */
+	VM_DONTDUMP	= BIT(26),		/* Do not include in the core dump */
 
 #ifdef CONFIG_MEM_SOFT_DIRTY
-# define VM_SOFTDIRTY	BIT(27)		/* Not soft dirty clean area */
+	VM_SOFTDIRTY	= BIT(27),		/* Not soft dirty clean area */
 #else
 # define VM_SOFTDIRTY	0
 #endif
 
-#define VM_MIXEDMAP	BIT(28)		/* Can contain "struct page" and pure PFN pages */
-#define VM_HUGEPAGE	BIT(29)		/* MADV_HUGEPAGE marked this vma */
-#define VM_NOHUGEPAGE	BIT(30)		/* MADV_NOHUGEPAGE marked this vma */
-#define VM_MERGEABLE	BIT(31)		/* KSM may merge identical pages */
+	VM_MIXEDMAP	= BIT(28),		/* Can contain "struct page" and pure PFN pages */
+	VM_HUGEPAGE	= BIT(29),		/* MADV_HUGEPAGE marked this vma */
+	VM_NOHUGEPAGE	= BIT(30),		/* MADV_NOHUGEPAGE marked this vma */
+	VM_MERGEABLE	= BIT(31),		/* KSM may merge identical pages */
 
 #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
 #define VM_HIGH_ARCH_BIT_0	32	/* bit only usable on 64-bit architectures */
@@ -333,14 +334,15 @@ extern unsigned int kobjsize(const void *objp);
 #define VM_HIGH_ARCH_BIT_4	36	/* bit only usable on 64-bit architectures */
 #define VM_HIGH_ARCH_BIT_5	37	/* bit only usable on 64-bit architectures */
 #define VM_HIGH_ARCH_BIT_6	38	/* bit only usable on 64-bit architectures */
-#define VM_HIGH_ARCH_0	BIT(VM_HIGH_ARCH_BIT_0)
-#define VM_HIGH_ARCH_1	BIT(VM_HIGH_ARCH_BIT_1)
-#define VM_HIGH_ARCH_2	BIT(VM_HIGH_ARCH_BIT_2)
-#define VM_HIGH_ARCH_3	BIT(VM_HIGH_ARCH_BIT_3)
-#define VM_HIGH_ARCH_4	BIT(VM_HIGH_ARCH_BIT_4)
-#define VM_HIGH_ARCH_5	BIT(VM_HIGH_ARCH_BIT_5)
-#define VM_HIGH_ARCH_6	BIT(VM_HIGH_ARCH_BIT_6)
+	VM_HIGH_ARCH_0	= BIT(VM_HIGH_ARCH_BIT_0),
+	VM_HIGH_ARCH_1	= BIT(VM_HIGH_ARCH_BIT_1),
+	VM_HIGH_ARCH_2	= BIT(VM_HIGH_ARCH_BIT_2),
+	VM_HIGH_ARCH_3	= BIT(VM_HIGH_ARCH_BIT_3),
+	VM_HIGH_ARCH_4	= BIT(VM_HIGH_ARCH_BIT_4),
+	VM_HIGH_ARCH_5	= BIT(VM_HIGH_ARCH_BIT_5),
+	VM_HIGH_ARCH_6	= BIT(VM_HIGH_ARCH_BIT_6),
 #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
+};
 
 #ifdef CONFIG_ARCH_HAS_PKEYS
 # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index 2e43c66635a2..04b75d4d01c3 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -108,7 +108,6 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;
 
 const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC = XA_FLAGS_ALLOC;
 const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC1 = XA_FLAGS_ALLOC1;
-const vm_flags_t RUST_CONST_HELPER_VM_MERGEABLE = VM_MERGEABLE;
 
 #if IS_ENABLED(CONFIG_ANDROID_BINDER_IPC_RUST)
 #include "../../drivers/android/binder/rust_binder.h"
-- 
2.51.0.618.g983fd99d29-goog


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-07 16:21 ` [PATCH] mm: use enum for vm_flags Alice Ryhl
@ 2025-10-07 17:01   ` Darrick J. Wong
  2025-10-08  2:36   ` John Hubbard
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Darrick J. Wong @ 2025-10-07 17:01 UTC (permalink / raw)
  To: Alice Ryhl
  Cc: acsjakub, akpm, axelrasmussen, chengming.zhou, david,
	linux-fsdevel, linux-kernel, linux-mm, peterx, xu.xin16,
	rust-for-linux

On Tue, Oct 07, 2025 at 04:21:36PM +0000, Alice Ryhl wrote:
> The bindgen tool is better able to handle BIT(_) declarations when used
> in an enum.
> 
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Hi Jakub,
> 
> what do you think about modifying the patch like this to use an enum? It
> resolves the issues brought up in
> 	https://lore.kernel.org/all/CAH5fLghTu-Zcm9e3Hy07nNtvB_-hRjojAWDoq-hhBYGE7LPEbQ@mail.gmail.com/
> 
> Feel free to squash this patch into your patch.
> 
>  include/linux/mm.h              | 90 +++++++++++++++++----------------
>  rust/bindings/bindings_helper.h |  1 -
>  2 files changed, 46 insertions(+), 45 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 7916d527f687..69da7ce13e50 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -273,57 +273,58 @@ extern unsigned int kobjsize(const void *objp);
>   * vm_flags in vm_area_struct, see mm_types.h.
>   * When changing, update also include/trace/events/mmflags.h
>   */
> -#define VM_NONE		0
> +enum {
> +	VM_NONE		= 0,
>  
> -#define VM_READ		BIT(0)		/* currently active flags */
> -#define VM_WRITE	BIT(1)
> -#define VM_EXEC		BIT(2)
> -#define VM_SHARED	BIT(3)
> +	VM_READ		= BIT(0),		/* currently active flags */
> +	VM_WRITE	= BIT(1),
> +	VM_EXEC		= BIT(2),
> +	VM_SHARED	= BIT(3),

mmflags.h contains ... a lot of macros, but I think if you change the
vmflags to an enum, you have to wrap every value of that enum in a
TRACE_DEFINE_ENUM or else __print_flags on an array(?) of {value,
string} pairs stops working.

Concretely, I think show_vma_flags (which uses __def_vmaflag_names) will
stop working here.  I'm no ftrace magician here, but AFAICT the third
argument to __print_flags is stored verbatim in the tracefs format file,
and the userspace ftrace tools use that to convert the raw data into a
user friendly string.  For whatever reason, enumerations aren't
converted to their underlying integer values by default, so the
userspace program can't do the translation.  TRACE_DEFINE_ENUM is a
magic that makes that happen.

<shrug> Don't mind me :)

--D

>  
>  /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
> -#define VM_MAYREAD	BIT(4)		/* limits for mprotect() etc */
> -#define VM_MAYWRITE	BIT(5)
> -#define VM_MAYEXEC	BIT(6)
> -#define VM_MAYSHARE	BIT(7)
> +	VM_MAYREAD	= BIT(4),		/* limits for mprotect() etc */
> +	VM_MAYWRITE	= BIT(5),
> +	VM_MAYEXEC	= BIT(6),
> +	VM_MAYSHARE	= BIT(7),
>  
> -#define VM_GROWSDOWN	BIT(8)		/* general info on the segment */
> +	VM_GROWSDOWN	= BIT(8),		/* general info on the segment */
>  #ifdef CONFIG_MMU
> -#define VM_UFFD_MISSING	BIT(9)		/* missing pages tracking */
> +	VM_UFFD_MISSING	= BIT(9),		/* missing pages tracking */
>  #else /* CONFIG_MMU */
> -#define VM_MAYOVERLAY	BIT(9)		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
> +	VM_MAYOVERLAY	= BIT(9),		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
>  #define VM_UFFD_MISSING	0
>  #endif /* CONFIG_MMU */
> -#define VM_PFNMAP	BIT(10)		/* Page-ranges managed without "struct page", just pure PFN */
> -#define VM_UFFD_WP	BIT(12)		/* wrprotect pages tracking */
> -
> -#define VM_LOCKED	BIT(13)
> -#define VM_IO           BIT(14)		/* Memory mapped I/O or similar */
> -
> -					/* Used by sys_madvise() */
> -#define VM_SEQ_READ	BIT(15)		/* App will access data sequentially */
> -#define VM_RAND_READ	BIT(16)		/* App will not benefit from clustered reads */
> -
> -#define VM_DONTCOPY	BIT(17)		/* Do not copy this vma on fork */
> -#define VM_DONTEXPAND	BIT(18)		/* Cannot expand with mremap() */
> -#define VM_LOCKONFAULT	BIT(19)		/* Lock the pages covered when they are faulted in */
> -#define VM_ACCOUNT	BIT(20)		/* Is a VM accounted object */
> -#define VM_NORESERVE	BIT(21)		/* should the VM suppress accounting */
> -#define VM_HUGETLB	BIT(22)		/* Huge TLB Page VM */
> -#define VM_SYNC		BIT(23)		/* Synchronous page faults */
> -#define VM_ARCH_1	BIT(24)		/* Architecture-specific flag */
> -#define VM_WIPEONFORK	BIT(25)		/* Wipe VMA contents in child. */
> -#define VM_DONTDUMP	BIT(26)		/* Do not include in the core dump */
> +	VM_PFNMAP	= BIT(10),		/* Page-ranges managed without "struct page", just pure PFN */
> +	VM_UFFD_WP	= BIT(12),		/* wrprotect pages tracking */
> +
> +	VM_LOCKED	= BIT(13),
> +	VM_IO           = BIT(14),		/* Memory mapped I/O or similar */
> +
> +						/* Used by sys_madvise() */
> +	VM_SEQ_READ	= BIT(15),		/* App will access data sequentially */
> +	VM_RAND_READ	= BIT(16),		/* App will not benefit from clustered reads */
> +
> +	VM_DONTCOPY	= BIT(17),		/* Do not copy this vma on fork */
> +	VM_DONTEXPAND	= BIT(18),		/* Cannot expand with mremap() */
> +	VM_LOCKONFAULT	= BIT(19),		/* Lock the pages covered when they are faulted in */
> +	VM_ACCOUNT	= BIT(20),		/* Is a VM accounted object */
> +	VM_NORESERVE	= BIT(21),		/* should the VM suppress accounting */
> +	VM_HUGETLB	= BIT(22),		/* Huge TLB Page VM */
> +	VM_SYNC		= BIT(23),		/* Synchronous page faults */
> +	VM_ARCH_1	= BIT(24),		/* Architecture-specific flag */
> +	VM_WIPEONFORK	= BIT(25),		/* Wipe VMA contents in child. */
> +	VM_DONTDUMP	= BIT(26),		/* Do not include in the core dump */
>  
>  #ifdef CONFIG_MEM_SOFT_DIRTY
> -# define VM_SOFTDIRTY	BIT(27)		/* Not soft dirty clean area */
> +	VM_SOFTDIRTY	= BIT(27),		/* Not soft dirty clean area */
>  #else
>  # define VM_SOFTDIRTY	0
>  #endif
>  
> -#define VM_MIXEDMAP	BIT(28)		/* Can contain "struct page" and pure PFN pages */
> -#define VM_HUGEPAGE	BIT(29)		/* MADV_HUGEPAGE marked this vma */
> -#define VM_NOHUGEPAGE	BIT(30)		/* MADV_NOHUGEPAGE marked this vma */
> -#define VM_MERGEABLE	BIT(31)		/* KSM may merge identical pages */
> +	VM_MIXEDMAP	= BIT(28),		/* Can contain "struct page" and pure PFN pages */
> +	VM_HUGEPAGE	= BIT(29),		/* MADV_HUGEPAGE marked this vma */
> +	VM_NOHUGEPAGE	= BIT(30),		/* MADV_NOHUGEPAGE marked this vma */
> +	VM_MERGEABLE	= BIT(31),		/* KSM may merge identical pages */
>  
>  #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
>  #define VM_HIGH_ARCH_BIT_0	32	/* bit only usable on 64-bit architectures */
> @@ -333,14 +334,15 @@ extern unsigned int kobjsize(const void *objp);
>  #define VM_HIGH_ARCH_BIT_4	36	/* bit only usable on 64-bit architectures */
>  #define VM_HIGH_ARCH_BIT_5	37	/* bit only usable on 64-bit architectures */
>  #define VM_HIGH_ARCH_BIT_6	38	/* bit only usable on 64-bit architectures */
> -#define VM_HIGH_ARCH_0	BIT(VM_HIGH_ARCH_BIT_0)
> -#define VM_HIGH_ARCH_1	BIT(VM_HIGH_ARCH_BIT_1)
> -#define VM_HIGH_ARCH_2	BIT(VM_HIGH_ARCH_BIT_2)
> -#define VM_HIGH_ARCH_3	BIT(VM_HIGH_ARCH_BIT_3)
> -#define VM_HIGH_ARCH_4	BIT(VM_HIGH_ARCH_BIT_4)
> -#define VM_HIGH_ARCH_5	BIT(VM_HIGH_ARCH_BIT_5)
> -#define VM_HIGH_ARCH_6	BIT(VM_HIGH_ARCH_BIT_6)
> +	VM_HIGH_ARCH_0	= BIT(VM_HIGH_ARCH_BIT_0),
> +	VM_HIGH_ARCH_1	= BIT(VM_HIGH_ARCH_BIT_1),
> +	VM_HIGH_ARCH_2	= BIT(VM_HIGH_ARCH_BIT_2),
> +	VM_HIGH_ARCH_3	= BIT(VM_HIGH_ARCH_BIT_3),
> +	VM_HIGH_ARCH_4	= BIT(VM_HIGH_ARCH_BIT_4),
> +	VM_HIGH_ARCH_5	= BIT(VM_HIGH_ARCH_BIT_5),
> +	VM_HIGH_ARCH_6	= BIT(VM_HIGH_ARCH_BIT_6),
>  #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
> +};
>  
>  #ifdef CONFIG_ARCH_HAS_PKEYS
>  # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0
> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> index 2e43c66635a2..04b75d4d01c3 100644
> --- a/rust/bindings/bindings_helper.h
> +++ b/rust/bindings/bindings_helper.h
> @@ -108,7 +108,6 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;
>  
>  const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC = XA_FLAGS_ALLOC;
>  const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC1 = XA_FLAGS_ALLOC1;
> -const vm_flags_t RUST_CONST_HELPER_VM_MERGEABLE = VM_MERGEABLE;
>  
>  #if IS_ENABLED(CONFIG_ANDROID_BINDER_IPC_RUST)
>  #include "../../drivers/android/binder/rust_binder.h"
> -- 
> 2.51.0.618.g983fd99d29-goog
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-07 16:21 ` [PATCH] mm: use enum for vm_flags Alice Ryhl
  2025-10-07 17:01   ` Darrick J. Wong
@ 2025-10-08  2:36   ` John Hubbard
  2025-10-08 12:54   ` Jakub Acs
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: John Hubbard @ 2025-10-08  2:36 UTC (permalink / raw)
  To: Alice Ryhl, acsjakub
  Cc: akpm, axelrasmussen, chengming.zhou, david, linux-fsdevel,
	linux-kernel, linux-mm, peterx, xu.xin16, rust-for-linux

On 10/7/25 9:21 AM, Alice Ryhl wrote:
> The bindgen tool is better able to handle BIT(_) declarations when used
> in an enum.
> 
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Hi Jakub,
> 
> what do you think about modifying the patch like this to use an enum? It
> resolves the issues brought up in
> 	https://lore.kernel.org/all/CAH5fLghTu-Zcm9e3Hy07nNtvB_-hRjojAWDoq-hhBYGE7LPEbQ@mail.gmail.com/
> 
> Feel free to squash this patch into your patch.
> 
>  include/linux/mm.h              | 90 +++++++++++++++++----------------
>  rust/bindings/bindings_helper.h |  1 -
>  2 files changed, 46 insertions(+), 45 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 7916d527f687..69da7ce13e50 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -273,57 +273,58 @@ extern unsigned int kobjsize(const void *objp);
>   * vm_flags in vm_area_struct, see mm_types.h.
>   * When changing, update also include/trace/events/mmflags.h
>   */
> -#define VM_NONE		0
> +enum {
> +	VM_NONE		= 0,
>  
> -#define VM_READ		BIT(0)		/* currently active flags */
> -#define VM_WRITE	BIT(1)
> -#define VM_EXEC		BIT(2)
> -#define VM_SHARED	BIT(3)
> +	VM_READ		= BIT(0),		/* currently active flags */
> +	VM_WRITE	= BIT(1),
> +	VM_EXEC		= BIT(2),
> +	VM_SHARED	= BIT(3),

Hi Alice,

If this approach actually works, then I think it is a reasonable
trade off, given that Rust's bindgen(1) is not going to be able
to help us for a while.

In other words, a small change to mm.h's format here, to avoid
a messy sort of "forked" copy of these over in 
rust/bindings/bindings_helper.h, seems better overall.

At least, I think it's better. :)

thanks,
John Hubbard

>  
>  /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
> -#define VM_MAYREAD	BIT(4)		/* limits for mprotect() etc */
> -#define VM_MAYWRITE	BIT(5)
> -#define VM_MAYEXEC	BIT(6)
> -#define VM_MAYSHARE	BIT(7)
> +	VM_MAYREAD	= BIT(4),		/* limits for mprotect() etc */
> +	VM_MAYWRITE	= BIT(5),
> +	VM_MAYEXEC	= BIT(6),
> +	VM_MAYSHARE	= BIT(7),
>  
> -#define VM_GROWSDOWN	BIT(8)		/* general info on the segment */
> +	VM_GROWSDOWN	= BIT(8),		/* general info on the segment */
>  #ifdef CONFIG_MMU
> -#define VM_UFFD_MISSING	BIT(9)		/* missing pages tracking */
> +	VM_UFFD_MISSING	= BIT(9),		/* missing pages tracking */
>  #else /* CONFIG_MMU */
> -#define VM_MAYOVERLAY	BIT(9)		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
> +	VM_MAYOVERLAY	= BIT(9),		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
>  #define VM_UFFD_MISSING	0
>  #endif /* CONFIG_MMU */
> -#define VM_PFNMAP	BIT(10)		/* Page-ranges managed without "struct page", just pure PFN */
> -#define VM_UFFD_WP	BIT(12)		/* wrprotect pages tracking */
> -
> -#define VM_LOCKED	BIT(13)
> -#define VM_IO           BIT(14)		/* Memory mapped I/O or similar */
> -
> -					/* Used by sys_madvise() */
> -#define VM_SEQ_READ	BIT(15)		/* App will access data sequentially */
> -#define VM_RAND_READ	BIT(16)		/* App will not benefit from clustered reads */
> -
> -#define VM_DONTCOPY	BIT(17)		/* Do not copy this vma on fork */
> -#define VM_DONTEXPAND	BIT(18)		/* Cannot expand with mremap() */
> -#define VM_LOCKONFAULT	BIT(19)		/* Lock the pages covered when they are faulted in */
> -#define VM_ACCOUNT	BIT(20)		/* Is a VM accounted object */
> -#define VM_NORESERVE	BIT(21)		/* should the VM suppress accounting */
> -#define VM_HUGETLB	BIT(22)		/* Huge TLB Page VM */
> -#define VM_SYNC		BIT(23)		/* Synchronous page faults */
> -#define VM_ARCH_1	BIT(24)		/* Architecture-specific flag */
> -#define VM_WIPEONFORK	BIT(25)		/* Wipe VMA contents in child. */
> -#define VM_DONTDUMP	BIT(26)		/* Do not include in the core dump */
> +	VM_PFNMAP	= BIT(10),		/* Page-ranges managed without "struct page", just pure PFN */
> +	VM_UFFD_WP	= BIT(12),		/* wrprotect pages tracking */
> +
> +	VM_LOCKED	= BIT(13),
> +	VM_IO           = BIT(14),		/* Memory mapped I/O or similar */
> +
> +						/* Used by sys_madvise() */
> +	VM_SEQ_READ	= BIT(15),		/* App will access data sequentially */
> +	VM_RAND_READ	= BIT(16),		/* App will not benefit from clustered reads */
> +
> +	VM_DONTCOPY	= BIT(17),		/* Do not copy this vma on fork */
> +	VM_DONTEXPAND	= BIT(18),		/* Cannot expand with mremap() */
> +	VM_LOCKONFAULT	= BIT(19),		/* Lock the pages covered when they are faulted in */
> +	VM_ACCOUNT	= BIT(20),		/* Is a VM accounted object */
> +	VM_NORESERVE	= BIT(21),		/* should the VM suppress accounting */
> +	VM_HUGETLB	= BIT(22),		/* Huge TLB Page VM */
> +	VM_SYNC		= BIT(23),		/* Synchronous page faults */
> +	VM_ARCH_1	= BIT(24),		/* Architecture-specific flag */
> +	VM_WIPEONFORK	= BIT(25),		/* Wipe VMA contents in child. */
> +	VM_DONTDUMP	= BIT(26),		/* Do not include in the core dump */
>  
>  #ifdef CONFIG_MEM_SOFT_DIRTY
> -# define VM_SOFTDIRTY	BIT(27)		/* Not soft dirty clean area */
> +	VM_SOFTDIRTY	= BIT(27),		/* Not soft dirty clean area */
>  #else
>  # define VM_SOFTDIRTY	0
>  #endif
>  
> -#define VM_MIXEDMAP	BIT(28)		/* Can contain "struct page" and pure PFN pages */
> -#define VM_HUGEPAGE	BIT(29)		/* MADV_HUGEPAGE marked this vma */
> -#define VM_NOHUGEPAGE	BIT(30)		/* MADV_NOHUGEPAGE marked this vma */
> -#define VM_MERGEABLE	BIT(31)		/* KSM may merge identical pages */
> +	VM_MIXEDMAP	= BIT(28),		/* Can contain "struct page" and pure PFN pages */
> +	VM_HUGEPAGE	= BIT(29),		/* MADV_HUGEPAGE marked this vma */
> +	VM_NOHUGEPAGE	= BIT(30),		/* MADV_NOHUGEPAGE marked this vma */
> +	VM_MERGEABLE	= BIT(31),		/* KSM may merge identical pages */
>  
>  #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
>  #define VM_HIGH_ARCH_BIT_0	32	/* bit only usable on 64-bit architectures */
> @@ -333,14 +334,15 @@ extern unsigned int kobjsize(const void *objp);
>  #define VM_HIGH_ARCH_BIT_4	36	/* bit only usable on 64-bit architectures */
>  #define VM_HIGH_ARCH_BIT_5	37	/* bit only usable on 64-bit architectures */
>  #define VM_HIGH_ARCH_BIT_6	38	/* bit only usable on 64-bit architectures */
> -#define VM_HIGH_ARCH_0	BIT(VM_HIGH_ARCH_BIT_0)
> -#define VM_HIGH_ARCH_1	BIT(VM_HIGH_ARCH_BIT_1)
> -#define VM_HIGH_ARCH_2	BIT(VM_HIGH_ARCH_BIT_2)
> -#define VM_HIGH_ARCH_3	BIT(VM_HIGH_ARCH_BIT_3)
> -#define VM_HIGH_ARCH_4	BIT(VM_HIGH_ARCH_BIT_4)
> -#define VM_HIGH_ARCH_5	BIT(VM_HIGH_ARCH_BIT_5)
> -#define VM_HIGH_ARCH_6	BIT(VM_HIGH_ARCH_BIT_6)
> +	VM_HIGH_ARCH_0	= BIT(VM_HIGH_ARCH_BIT_0),
> +	VM_HIGH_ARCH_1	= BIT(VM_HIGH_ARCH_BIT_1),
> +	VM_HIGH_ARCH_2	= BIT(VM_HIGH_ARCH_BIT_2),
> +	VM_HIGH_ARCH_3	= BIT(VM_HIGH_ARCH_BIT_3),
> +	VM_HIGH_ARCH_4	= BIT(VM_HIGH_ARCH_BIT_4),
> +	VM_HIGH_ARCH_5	= BIT(VM_HIGH_ARCH_BIT_5),
> +	VM_HIGH_ARCH_6	= BIT(VM_HIGH_ARCH_BIT_6),
>  #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
> +};
>  
>  #ifdef CONFIG_ARCH_HAS_PKEYS
>  # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0
> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> index 2e43c66635a2..04b75d4d01c3 100644
> --- a/rust/bindings/bindings_helper.h
> +++ b/rust/bindings/bindings_helper.h
> @@ -108,7 +108,6 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;
>  
>  const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC = XA_FLAGS_ALLOC;
>  const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC1 = XA_FLAGS_ALLOC1;
> -const vm_flags_t RUST_CONST_HELPER_VM_MERGEABLE = VM_MERGEABLE;
>  
>  #if IS_ENABLED(CONFIG_ANDROID_BINDER_IPC_RUST)
>  #include "../../drivers/android/binder/rust_binder.h"



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] mm: use enum for vm_flags
  2025-10-07 16:21 ` [PATCH] mm: use enum for vm_flags Alice Ryhl
  2025-10-07 17:01   ` Darrick J. Wong
  2025-10-08  2:36   ` John Hubbard
@ 2025-10-08 12:54   ` Jakub Acs
  2025-10-08 13:15     ` Alice Ryhl
                       ` (4 more replies)
  2025-10-10 16:13   ` kernel test robot
  2025-10-11  0:50   ` kernel test robot
  4 siblings, 5 replies; 15+ messages in thread
From: Jakub Acs @ 2025-10-08 12:54 UTC (permalink / raw)
  To: aliceryhl, djwong
  Cc: jhubbard, acsjakub, akpm, axelrasmussen, chengming.zhou, david,
	linux-fsdevel, linux-kernel, linux-mm, peterx, rust-for-linux,
	xu.xin16

redefine VM_* flag constants with BIT()

Make VM_* flag constant definitions consistent - unify all to use BIT()
macro and define them within an enum.

The bindgen tool is better able to handle BIT(_) declarations when used
in an enum.

Also add enum definitions for tracepoints.

We have previously changed VM_MERGEABLE in a separate bugfix. This is a
follow-up to make all the VM_* flag constant definitions consistent, as
suggested by David in [1].

[1]: https://lore.kernel.org/all/85f852f9-8577-4230-adc7-c52e7f479454@redhat.com/

Signed-off-by: Jakub Acs <acsjakub@amazon.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Xu Xin <xu.xin16@zte.com.cn>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Peter Xu <peterx@redhat.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
---

Hi Alice,

thanks for the patch, I squashed it in (should I add your signed-off-by
too?) and added the TRACE_DEFINE_ENUM calls pointed out by Derrick.

I have the following points to still address, though: 

- can the fact that we're not controlling the type of the values if
  using enum be a problem? (likely the indirect control we have through
  the highest value is good enough, but I'm not sure)

- where do TRACE_DEFINE_ENUM calls belong?
  I see them placed e.g. in include/trace/misc/nfs.h for nfs or
  arch/x86/kvm/mmu/mmutrace.h, but I don't see a corresponding file for
  mm.h - does this warrant creating a separate file for these
  definitions?

- with the need for TRACE_DEFINE_ENUM calls, do we still deem this
  to be a good trade-off? - isn't fixing all of these in
  rust/bindings/bindings_helper.h better?

@Derrick, can you point me to how to test for the issue you pointed out?

Thanks,
Jakub


 include/linux/mm.h              | 142 ++++++++++++++++++++++----------
 rust/bindings/bindings_helper.h |   1 -
 2 files changed, 98 insertions(+), 45 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 70a2a76007d4..8b9e7a9e7042 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -36,6 +36,7 @@
 #include <linux/rcuwait.h>
 #include <linux/bitmap.h>
 #include <linux/bitops.h>
+#include <linux/tracepoint.h>
 
 struct mempolicy;
 struct anon_vma;
@@ -273,57 +274,58 @@ extern unsigned int kobjsize(const void *objp);
  * vm_flags in vm_area_struct, see mm_types.h.
  * When changing, update also include/trace/events/mmflags.h
  */
-#define VM_NONE		0x00000000
+enum {
+	VM_NONE		= 0,
 
-#define VM_READ		0x00000001	/* currently active flags */
-#define VM_WRITE	0x00000002
-#define VM_EXEC		0x00000004
-#define VM_SHARED	0x00000008
+	VM_READ		= BIT(0),		/* currently active flags */
+	VM_WRITE	= BIT(1),
+	VM_EXEC		= BIT(2),
+	VM_SHARED	= BIT(3),
 
 /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
-#define VM_MAYREAD	0x00000010	/* limits for mprotect() etc */
-#define VM_MAYWRITE	0x00000020
-#define VM_MAYEXEC	0x00000040
-#define VM_MAYSHARE	0x00000080
+	VM_MAYREAD	= BIT(4),		/* limits for mprotect() etc */
+	VM_MAYWRITE	= BIT(5),
+	VM_MAYEXEC	= BIT(6),
+	VM_MAYSHARE	= BIT(7),
 
-#define VM_GROWSDOWN	0x00000100	/* general info on the segment */
+	VM_GROWSDOWN	= BIT(8),		/* general info on the segment */
 #ifdef CONFIG_MMU
-#define VM_UFFD_MISSING	0x00000200	/* missing pages tracking */
+	VM_UFFD_MISSING	= BIT(9),		/* missing pages tracking */
 #else /* CONFIG_MMU */
-#define VM_MAYOVERLAY	0x00000200	/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
+	VM_MAYOVERLAY	= BIT(9),		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
 #define VM_UFFD_MISSING	0
 #endif /* CONFIG_MMU */
-#define VM_PFNMAP	0x00000400	/* Page-ranges managed without "struct page", just pure PFN */
-#define VM_UFFD_WP	0x00001000	/* wrprotect pages tracking */
-
-#define VM_LOCKED	0x00002000
-#define VM_IO           0x00004000	/* Memory mapped I/O or similar */
-
-					/* Used by sys_madvise() */
-#define VM_SEQ_READ	0x00008000	/* App will access data sequentially */
-#define VM_RAND_READ	0x00010000	/* App will not benefit from clustered reads */
-
-#define VM_DONTCOPY	0x00020000      /* Do not copy this vma on fork */
-#define VM_DONTEXPAND	0x00040000	/* Cannot expand with mremap() */
-#define VM_LOCKONFAULT	0x00080000	/* Lock the pages covered when they are faulted in */
-#define VM_ACCOUNT	0x00100000	/* Is a VM accounted object */
-#define VM_NORESERVE	0x00200000	/* should the VM suppress accounting */
-#define VM_HUGETLB	0x00400000	/* Huge TLB Page VM */
-#define VM_SYNC		0x00800000	/* Synchronous page faults */
-#define VM_ARCH_1	0x01000000	/* Architecture-specific flag */
-#define VM_WIPEONFORK	0x02000000	/* Wipe VMA contents in child. */
-#define VM_DONTDUMP	0x04000000	/* Do not include in the core dump */
+	VM_PFNMAP	= BIT(10),		/* Page-ranges managed without "struct page", just pure PFN */
+	VM_UFFD_WP	= BIT(12),		/* wrprotect pages tracking */
+
+	VM_LOCKED	= BIT(13),
+	VM_IO           = BIT(14),		/* Memory mapped I/O or similar */
+
+						/* Used by sys_madvise() */
+	VM_SEQ_READ	= BIT(15),		/* App will access data sequentially */
+	VM_RAND_READ	= BIT(16),		/* App will not benefit from clustered reads */
+
+	VM_DONTCOPY	= BIT(17),		/* Do not copy this vma on fork */
+	VM_DONTEXPAND	= BIT(18),		/* Cannot expand with mremap() */
+	VM_LOCKONFAULT	= BIT(19),		/* Lock the pages covered when they are faulted in */
+	VM_ACCOUNT	= BIT(20),		/* Is a VM accounted object */
+	VM_NORESERVE	= BIT(21),		/* should the VM suppress accounting */
+	VM_HUGETLB	= BIT(22),		/* Huge TLB Page VM */
+	VM_SYNC		= BIT(23),		/* Synchronous page faults */
+	VM_ARCH_1	= BIT(24),		/* Architecture-specific flag */
+	VM_WIPEONFORK	= BIT(25),		/* Wipe VMA contents in child. */
+	VM_DONTDUMP	= BIT(26),		/* Do not include in the core dump */
 
 #ifdef CONFIG_MEM_SOFT_DIRTY
-# define VM_SOFTDIRTY	0x08000000	/* Not soft dirty clean area */
+	VM_SOFTDIRTY	= BIT(27),		/* Not soft dirty clean area */
 #else
 # define VM_SOFTDIRTY	0
 #endif
 
-#define VM_MIXEDMAP	0x10000000	/* Can contain "struct page" and pure PFN pages */
-#define VM_HUGEPAGE	0x20000000	/* MADV_HUGEPAGE marked this vma */
-#define VM_NOHUGEPAGE	0x40000000	/* MADV_NOHUGEPAGE marked this vma */
-#define VM_MERGEABLE	BIT(31)		/* KSM may merge identical pages */
+	VM_MIXEDMAP	= BIT(28),		/* Can contain "struct page" and pure PFN pages */
+	VM_HUGEPAGE	= BIT(29),		/* MADV_HUGEPAGE marked this vma */
+	VM_NOHUGEPAGE	= BIT(30),		/* MADV_NOHUGEPAGE marked this vma */
+	VM_MERGEABLE	= BIT(31),		/* KSM may merge identical pages */
 
 #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
 #define VM_HIGH_ARCH_BIT_0	32	/* bit only usable on 64-bit architectures */
@@ -333,14 +335,66 @@ extern unsigned int kobjsize(const void *objp);
 #define VM_HIGH_ARCH_BIT_4	36	/* bit only usable on 64-bit architectures */
 #define VM_HIGH_ARCH_BIT_5	37	/* bit only usable on 64-bit architectures */
 #define VM_HIGH_ARCH_BIT_6	38	/* bit only usable on 64-bit architectures */
-#define VM_HIGH_ARCH_0	BIT(VM_HIGH_ARCH_BIT_0)
-#define VM_HIGH_ARCH_1	BIT(VM_HIGH_ARCH_BIT_1)
-#define VM_HIGH_ARCH_2	BIT(VM_HIGH_ARCH_BIT_2)
-#define VM_HIGH_ARCH_3	BIT(VM_HIGH_ARCH_BIT_3)
-#define VM_HIGH_ARCH_4	BIT(VM_HIGH_ARCH_BIT_4)
-#define VM_HIGH_ARCH_5	BIT(VM_HIGH_ARCH_BIT_5)
-#define VM_HIGH_ARCH_6	BIT(VM_HIGH_ARCH_BIT_6)
+	VM_HIGH_ARCH_0	= BIT(VM_HIGH_ARCH_BIT_0),
+	VM_HIGH_ARCH_1	= BIT(VM_HIGH_ARCH_BIT_1),
+	VM_HIGH_ARCH_2	= BIT(VM_HIGH_ARCH_BIT_2),
+	VM_HIGH_ARCH_3	= BIT(VM_HIGH_ARCH_BIT_3),
+	VM_HIGH_ARCH_4	= BIT(VM_HIGH_ARCH_BIT_4),
+	VM_HIGH_ARCH_5	= BIT(VM_HIGH_ARCH_BIT_5),
+	VM_HIGH_ARCH_6	= BIT(VM_HIGH_ARCH_BIT_6),
 #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
+};
+
+TRACE_DEFINE_ENUM(VM_NONE);
+TRACE_DEFINE_ENUM(VM_READ);
+TRACE_DEFINE_ENUM(VM_WRITE);
+TRACE_DEFINE_ENUM(VM_EXEC);
+TRACE_DEFINE_ENUM(VM_SHARED);
+TRACE_DEFINE_ENUM(VM_MAYREAD);
+TRACE_DEFINE_ENUM(VM_MAYWRITE);
+TRACE_DEFINE_ENUM(VM_MAYEXEC);
+TRACE_DEFINE_ENUM(VM_MAYSHARE);
+TRACE_DEFINE_ENUM(VM_GROWSDOWN);
+TRACE_DEFINE_ENUM(VM_UFFD_MISSING);
+
+#ifndef CONFIG_MMU
+TRACE_DEFINE_ENUM(VM_MAYOVERLAY);
+#endif /* CONFIG_MMU */
+
+TRACE_DEFINE_ENUM(VM_PFNMAP);
+TRACE_DEFINE_ENUM(VM_UFFD_WP);
+TRACE_DEFINE_ENUM(VM_LOCKED);
+TRACE_DEFINE_ENUM(VM_IO);
+TRACE_DEFINE_ENUM(VM_SEQ_READ);
+TRACE_DEFINE_ENUM(VM_RAND_READ);
+TRACE_DEFINE_ENUM(VM_DONTCOPY);
+TRACE_DEFINE_ENUM(VM_DONTEXPAND);
+TRACE_DEFINE_ENUM(VM_LOCKONFAULT);
+TRACE_DEFINE_ENUM(VM_ACCOUNT);
+TRACE_DEFINE_ENUM(VM_NORESERVE);
+TRACE_DEFINE_ENUM(VM_HUGETLB);
+TRACE_DEFINE_ENUM(VM_SYNC);
+TRACE_DEFINE_ENUM(VM_ARCH_1);
+TRACE_DEFINE_ENUM(VM_WIPEONFORK);
+TRACE_DEFINE_ENUM(VM_DONTDUMP);
+
+TRACE_DEFINE_ENUM(VM_SOFTDIRTY);
+
+TRACE_DEFINE_ENUM(VM_MIXEDMAP);
+TRACE_DEFINE_ENUM(VM_HUGEPAGE);
+TRACE_DEFINE_ENUM(VM_NOHUGEPAGE);
+TRACE_DEFINE_ENUM(VM_MERGEABLE);
+
+#ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
+TRACE_DEFINE_ENUM(VM_HIGH_ARCH_0);
+TRACE_DEFINE_ENUM(VM_HIGH_ARCH_1);
+TRACE_DEFINE_ENUM(VM_HIGH_ARCH_2);
+TRACE_DEFINE_ENUM(VM_HIGH_ARCH_3);
+TRACE_DEFINE_ENUM(VM_HIGH_ARCH_4);
+TRACE_DEFINE_ENUM(VM_HIGH_ARCH_5);
+TRACE_DEFINE_ENUM(VM_HIGH_ARCH_6);
+#endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
+
 
 #ifdef CONFIG_ARCH_HAS_PKEYS
 # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index 2e43c66635a2..04b75d4d01c3 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -108,7 +108,6 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;
 
 const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC = XA_FLAGS_ALLOC;
 const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC1 = XA_FLAGS_ALLOC1;
-const vm_flags_t RUST_CONST_HELPER_VM_MERGEABLE = VM_MERGEABLE;
 
 #if IS_ENABLED(CONFIG_ANDROID_BINDER_IPC_RUST)
 #include "../../drivers/android/binder/rust_binder.h"
-- 
2.47.3




Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-08 12:54   ` Jakub Acs
@ 2025-10-08 13:15     ` Alice Ryhl
  2025-10-10 15:10       ` Darrick J. Wong
  2025-10-08 14:17     ` Steven Rostedt
                       ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Alice Ryhl @ 2025-10-08 13:15 UTC (permalink / raw)
  To: Jakub Acs
  Cc: djwong, jhubbard, akpm, axelrasmussen, chengming.zhou, david,
	linux-fsdevel, linux-kernel, linux-mm, peterx, rust-for-linux,
	xu.xin16

On Wed, Oct 08, 2025 at 12:54:27PM +0000, Jakub Acs wrote:
> redefine VM_* flag constants with BIT()
> 
> Make VM_* flag constant definitions consistent - unify all to use BIT()
> macro and define them within an enum.
> 
> The bindgen tool is better able to handle BIT(_) declarations when used
> in an enum.
> 
> Also add enum definitions for tracepoints.
> 
> We have previously changed VM_MERGEABLE in a separate bugfix. This is a
> follow-up to make all the VM_* flag constant definitions consistent, as
> suggested by David in [1].
> 
> [1]: https://lore.kernel.org/all/85f852f9-8577-4230-adc7-c52e7f479454@redhat.com/
> 
> Signed-off-by: Jakub Acs <acsjakub@amazon.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Xu Xin <xu.xin16@zte.com.cn>
> Cc: Chengming Zhou <chengming.zhou@linux.dev>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Axel Rasmussen <axelrasmussen@google.com>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> ---
> 
> Hi Alice,
> 
> thanks for the patch, I squashed it in (should I add your signed-off-by
> too?) and added the TRACE_DEFINE_ENUM calls pointed out by Derrick.

You could add this if you go with the enum approach:

Co-Developed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

> I have the following points to still address, though: 
> 
> - can the fact that we're not controlling the type of the values if
>   using enum be a problem? (likely the indirect control we have through
>   the highest value is good enough, but I'm not sure)

The compiler should pick the right integer type in this case.

> - where do TRACE_DEFINE_ENUM calls belong?
>   I see them placed e.g. in include/trace/misc/nfs.h for nfs or
>   arch/x86/kvm/mmu/mmutrace.h, but I don't see a corresponding file for
>   mm.h - does this warrant creating a separate file for these
>   definitions?
> 
> - with the need for TRACE_DEFINE_ENUM calls, do we still deem this
>   to be a good trade-off? - isn't fixing all of these in
>   rust/bindings/bindings_helper.h better?
> 
> @Derrick, can you point me to how to test for the issue you pointed out?

I'm not familiar with the TRACE_DEFINE_ENUM unfortunately.

> +#ifndef CONFIG_MMU
> +TRACE_DEFINE_ENUM(VM_MAYOVERLAY);
> +#endif /* CONFIG_MMU */

Here I think you want:

#ifdef CONFIG_MMU
TRACE_DEFINE_ENUM(VM_UFFD_MISSING);
#else
TRACE_DEFINE_ENUM(VM_MAYOVERLAY);
#endif /* CONFIG_MMU */

> +TRACE_DEFINE_ENUM(VM_SOFTDIRTY);

Here I think you want:

#ifdef CONFIG_MEM_SOFT_DIRTY
TRACE_DEFINE_ENUM(VM_SOFTDIRTY);
#endif

Alice

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-08 12:54   ` Jakub Acs
  2025-10-08 13:15     ` Alice Ryhl
@ 2025-10-08 14:17     ` Steven Rostedt
  2025-10-09  2:33     ` John Hubbard
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Steven Rostedt @ 2025-10-08 14:17 UTC (permalink / raw)
  To: Jakub Acs
  Cc: aliceryhl, djwong, jhubbard, akpm, axelrasmussen, chengming.zhou,
	david, linux-fsdevel, linux-kernel, linux-mm, peterx,
	rust-for-linux, xu.xin16

On Wed, 8 Oct 2025 12:54:27 +0000
Jakub Acs <acsjakub@amazon.de> wrote:


> Hi Alice,
> 
> thanks for the patch, I squashed it in (should I add your signed-off-by
> too?) and added the TRACE_DEFINE_ENUM calls pointed out by Derrick.
> 
> I have the following points to still address, though: 
> 
> - can the fact that we're not controlling the type of the values if
>   using enum be a problem? (likely the indirect control we have through
>   the highest value is good enough, but I'm not sure)
> 
> - where do TRACE_DEFINE_ENUM calls belong?

It's probably best to put them in include/trace/events/mmflags.h

>   I see them placed e.g. in include/trace/misc/nfs.h for nfs or
>   arch/x86/kvm/mmu/mmutrace.h, but I don't see a corresponding file for
>   mm.h - does this warrant creating a separate file for these
>   definitions?
> 
> - with the need for TRACE_DEFINE_ENUM calls, do we still deem this
>   to be a good trade-off? - isn't fixing all of these in
>   rust/bindings/bindings_helper.h better?

There's tricks to add a bunch of TRACE_DEFINE_ENUM()s at once. In fact,
look at how the macro TRACE_GFP_FLAGS_GENERAL is used in that mmflags.h
file.

The reason macros work but enums do not is because the pre-processor
converts macros to their original values but not enums. The TRACE_EVENT()
converts the "printf" part into a string. The macros are changes to their
values, but enums do not get changed.

The TRACE_DEFINE_ENUM() macro adds magic to map the name of the enum to its
value, and on boot up, the printf formats have the enums convert to the
values. Note, I'm working on having this performed at build time.

-- Steve

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-08 12:54   ` Jakub Acs
  2025-10-08 13:15     ` Alice Ryhl
  2025-10-08 14:17     ` Steven Rostedt
@ 2025-10-09  2:33     ` John Hubbard
  2025-10-11  0:18     ` kernel test robot
  2025-10-11  0:39     ` kernel test robot
  4 siblings, 0 replies; 15+ messages in thread
From: John Hubbard @ 2025-10-09  2:33 UTC (permalink / raw)
  To: Jakub Acs, aliceryhl, djwong
  Cc: akpm, axelrasmussen, chengming.zhou, david, linux-fsdevel,
	linux-kernel, linux-mm, peterx, rust-for-linux, xu.xin16

On 10/8/25 5:54 AM, Jakub Acs wrote:
> redefine VM_* flag constants with BIT()
> 
> Make VM_* flag constant definitions consistent - unify all to use BIT()
> macro and define them within an enum.
> 
> The bindgen tool is better able to handle BIT(_) declarations when used
> in an enum.
> 
> Also add enum definitions for tracepoints.
> 
> We have previously changed VM_MERGEABLE in a separate bugfix. This is a
> follow-up to make all the VM_* flag constant definitions consistent, as
> suggested by David in [1].
> 
> [1]: https://lore.kernel.org/all/85f852f9-8577-4230-adc7-c52e7f479454@redhat.com/
> 
> Signed-off-by: Jakub Acs <acsjakub@amazon.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Xu Xin <xu.xin16@zte.com.cn>
> Cc: Chengming Zhou <chengming.zhou@linux.dev>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Axel Rasmussen <axelrasmussen@google.com>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> ---
> 
> Hi Alice,
> 
> thanks for the patch, I squashed it in (should I add your signed-off-by
> too?) and added the TRACE_DEFINE_ENUM calls pointed out by Derrick.
> 
> I have the following points to still address, though: 
> 
> - can the fact that we're not controlling the type of the values if
>   using enum be a problem? (likely the indirect control we have through
>   the highest value is good enough, but I'm not sure)
> 
> - where do TRACE_DEFINE_ENUM calls belong?
>   I see them placed e.g. in include/trace/misc/nfs.h for nfs or
>   arch/x86/kvm/mmu/mmutrace.h, but I don't see a corresponding file for
>   mm.h - does this warrant creating a separate file for these
>   definitions?
> 
> - with the need for TRACE_DEFINE_ENUM calls, do we still deem this
>   to be a good trade-off? - isn't fixing all of these in
>   rust/bindings/bindings_helper.h better?
> 
> @Derrick, can you point me to how to test for the issue you pointed out?
> 
> Thanks,
> Jakub
> 
> 
>  include/linux/mm.h              | 142 ++++++++++++++++++++++----------
>  rust/bindings/bindings_helper.h |   1 -
>  2 files changed, 98 insertions(+), 45 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 70a2a76007d4..8b9e7a9e7042 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -36,6 +36,7 @@
>  #include <linux/rcuwait.h>
>  #include <linux/bitmap.h>
>  #include <linux/bitops.h>
> +#include <linux/tracepoint.h>
>  
>  struct mempolicy;
>  struct anon_vma;
> @@ -273,57 +274,58 @@ extern unsigned int kobjsize(const void *objp);
>   * vm_flags in vm_area_struct, see mm_types.h.
>   * When changing, update also include/trace/events/mmflags.h
>   */
> -#define VM_NONE		0x00000000
> +enum {
> +	VM_NONE		= 0,
>  
> -#define VM_READ		0x00000001	/* currently active flags */
> -#define VM_WRITE	0x00000002
> -#define VM_EXEC		0x00000004
> -#define VM_SHARED	0x00000008
> +	VM_READ		= BIT(0),		/* currently active flags */
> +	VM_WRITE	= BIT(1),
> +	VM_EXEC		= BIT(2),
> +	VM_SHARED	= BIT(3),
>  
>  /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
> -#define VM_MAYREAD	0x00000010	/* limits for mprotect() etc */
> -#define VM_MAYWRITE	0x00000020
> -#define VM_MAYEXEC	0x00000040
> -#define VM_MAYSHARE	0x00000080
> +	VM_MAYREAD	= BIT(4),		/* limits for mprotect() etc */
> +	VM_MAYWRITE	= BIT(5),
> +	VM_MAYEXEC	= BIT(6),
> +	VM_MAYSHARE	= BIT(7),
>  
> -#define VM_GROWSDOWN	0x00000100	/* general info on the segment */
> +	VM_GROWSDOWN	= BIT(8),		/* general info on the segment */
>  #ifdef CONFIG_MMU
> -#define VM_UFFD_MISSING	0x00000200	/* missing pages tracking */
> +	VM_UFFD_MISSING	= BIT(9),		/* missing pages tracking */
>  #else /* CONFIG_MMU */
> -#define VM_MAYOVERLAY	0x00000200	/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
> +	VM_MAYOVERLAY	= BIT(9),		/* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
>  #define VM_UFFD_MISSING	0
>  #endif /* CONFIG_MMU */
> -#define VM_PFNMAP	0x00000400	/* Page-ranges managed without "struct page", just pure PFN */
> -#define VM_UFFD_WP	0x00001000	/* wrprotect pages tracking */
> -
> -#define VM_LOCKED	0x00002000
> -#define VM_IO           0x00004000	/* Memory mapped I/O or similar */
> -
> -					/* Used by sys_madvise() */
> -#define VM_SEQ_READ	0x00008000	/* App will access data sequentially */
> -#define VM_RAND_READ	0x00010000	/* App will not benefit from clustered reads */
> -
> -#define VM_DONTCOPY	0x00020000      /* Do not copy this vma on fork */
> -#define VM_DONTEXPAND	0x00040000	/* Cannot expand with mremap() */
> -#define VM_LOCKONFAULT	0x00080000	/* Lock the pages covered when they are faulted in */
> -#define VM_ACCOUNT	0x00100000	/* Is a VM accounted object */
> -#define VM_NORESERVE	0x00200000	/* should the VM suppress accounting */
> -#define VM_HUGETLB	0x00400000	/* Huge TLB Page VM */
> -#define VM_SYNC		0x00800000	/* Synchronous page faults */
> -#define VM_ARCH_1	0x01000000	/* Architecture-specific flag */
> -#define VM_WIPEONFORK	0x02000000	/* Wipe VMA contents in child. */
> -#define VM_DONTDUMP	0x04000000	/* Do not include in the core dump */
> +	VM_PFNMAP	= BIT(10),		/* Page-ranges managed without "struct page", just pure PFN */
> +	VM_UFFD_WP	= BIT(12),		/* wrprotect pages tracking */
> +
> +	VM_LOCKED	= BIT(13),
> +	VM_IO           = BIT(14),		/* Memory mapped I/O or similar */
> +
> +						/* Used by sys_madvise() */
> +	VM_SEQ_READ	= BIT(15),		/* App will access data sequentially */
> +	VM_RAND_READ	= BIT(16),		/* App will not benefit from clustered reads */
> +
> +	VM_DONTCOPY	= BIT(17),		/* Do not copy this vma on fork */
> +	VM_DONTEXPAND	= BIT(18),		/* Cannot expand with mremap() */
> +	VM_LOCKONFAULT	= BIT(19),		/* Lock the pages covered when they are faulted in */
> +	VM_ACCOUNT	= BIT(20),		/* Is a VM accounted object */
> +	VM_NORESERVE	= BIT(21),		/* should the VM suppress accounting */
> +	VM_HUGETLB	= BIT(22),		/* Huge TLB Page VM */
> +	VM_SYNC		= BIT(23),		/* Synchronous page faults */
> +	VM_ARCH_1	= BIT(24),		/* Architecture-specific flag */
> +	VM_WIPEONFORK	= BIT(25),		/* Wipe VMA contents in child. */
> +	VM_DONTDUMP	= BIT(26),		/* Do not include in the core dump */
>  
>  #ifdef CONFIG_MEM_SOFT_DIRTY
> -# define VM_SOFTDIRTY	0x08000000	/* Not soft dirty clean area */
> +	VM_SOFTDIRTY	= BIT(27),		/* Not soft dirty clean area */
>  #else
>  # define VM_SOFTDIRTY	0
>  #endif
>  
> -#define VM_MIXEDMAP	0x10000000	/* Can contain "struct page" and pure PFN pages */
> -#define VM_HUGEPAGE	0x20000000	/* MADV_HUGEPAGE marked this vma */
> -#define VM_NOHUGEPAGE	0x40000000	/* MADV_NOHUGEPAGE marked this vma */
> -#define VM_MERGEABLE	BIT(31)		/* KSM may merge identical pages */
> +	VM_MIXEDMAP	= BIT(28),		/* Can contain "struct page" and pure PFN pages */
> +	VM_HUGEPAGE	= BIT(29),		/* MADV_HUGEPAGE marked this vma */
> +	VM_NOHUGEPAGE	= BIT(30),		/* MADV_NOHUGEPAGE marked this vma */
> +	VM_MERGEABLE	= BIT(31),		/* KSM may merge identical pages */
>  
>  #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
>  #define VM_HIGH_ARCH_BIT_0	32	/* bit only usable on 64-bit architectures */
> @@ -333,14 +335,66 @@ extern unsigned int kobjsize(const void *objp);
>  #define VM_HIGH_ARCH_BIT_4	36	/* bit only usable on 64-bit architectures */
>  #define VM_HIGH_ARCH_BIT_5	37	/* bit only usable on 64-bit architectures */
>  #define VM_HIGH_ARCH_BIT_6	38	/* bit only usable on 64-bit architectures */

Is there really any value in having these defines, at this point?

See below...

> -#define VM_HIGH_ARCH_0	BIT(VM_HIGH_ARCH_BIT_0)
> -#define VM_HIGH_ARCH_1	BIT(VM_HIGH_ARCH_BIT_1)
> -#define VM_HIGH_ARCH_2	BIT(VM_HIGH_ARCH_BIT_2)
> -#define VM_HIGH_ARCH_3	BIT(VM_HIGH_ARCH_BIT_3)
> -#define VM_HIGH_ARCH_4	BIT(VM_HIGH_ARCH_BIT_4)
> -#define VM_HIGH_ARCH_5	BIT(VM_HIGH_ARCH_BIT_5)
> -#define VM_HIGH_ARCH_6	BIT(VM_HIGH_ARCH_BIT_6)
> +	VM_HIGH_ARCH_0	= BIT(VM_HIGH_ARCH_BIT_0),

Or just omit those bit 0 to bit 7 defines, and write:

	VM_HIGH_ARCH_0	= BIT(32),
	...etc

> +	VM_HIGH_ARCH_1	= BIT(VM_HIGH_ARCH_BIT_1),
> +	VM_HIGH_ARCH_2	= BIT(VM_HIGH_ARCH_BIT_2),
> +	VM_HIGH_ARCH_3	= BIT(VM_HIGH_ARCH_BIT_3),
> +	VM_HIGH_ARCH_4	= BIT(VM_HIGH_ARCH_BIT_4),
> +	VM_HIGH_ARCH_5	= BIT(VM_HIGH_ARCH_BIT_5),
> +	VM_HIGH_ARCH_6	= BIT(VM_HIGH_ARCH_BIT_6),


>  #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
> +};
> +
> +TRACE_DEFINE_ENUM(VM_NONE);
> +TRACE_DEFINE_ENUM(VM_READ);
> +TRACE_DEFINE_ENUM(VM_WRITE);
> +TRACE_DEFINE_ENUM(VM_EXEC);
> +TRACE_DEFINE_ENUM(VM_SHARED);
> +TRACE_DEFINE_ENUM(VM_MAYREAD);
> +TRACE_DEFINE_ENUM(VM_MAYWRITE);
> +TRACE_DEFINE_ENUM(VM_MAYEXEC);
> +TRACE_DEFINE_ENUM(VM_MAYSHARE);
> +TRACE_DEFINE_ENUM(VM_GROWSDOWN);
> +TRACE_DEFINE_ENUM(VM_UFFD_MISSING);
> +
> +#ifndef CONFIG_MMU
> +TRACE_DEFINE_ENUM(VM_MAYOVERLAY);

The ifdef handling here for these two items, VM_UFFD_MISSING
and VM_MAYOVERLAY, does not seem to match the way they are handled
above in the enum.

> +#endif /* CONFIG_MMU */
> +
> +TRACE_DEFINE_ENUM(VM_PFNMAP);
> +TRACE_DEFINE_ENUM(VM_UFFD_WP);
> +TRACE_DEFINE_ENUM(VM_LOCKED);
> +TRACE_DEFINE_ENUM(VM_IO);
> +TRACE_DEFINE_ENUM(VM_SEQ_READ);
> +TRACE_DEFINE_ENUM(VM_RAND_READ);
> +TRACE_DEFINE_ENUM(VM_DONTCOPY);
> +TRACE_DEFINE_ENUM(VM_DONTEXPAND);
> +TRACE_DEFINE_ENUM(VM_LOCKONFAULT);
> +TRACE_DEFINE_ENUM(VM_ACCOUNT);
> +TRACE_DEFINE_ENUM(VM_NORESERVE);
> +TRACE_DEFINE_ENUM(VM_HUGETLB);
> +TRACE_DEFINE_ENUM(VM_SYNC);
> +TRACE_DEFINE_ENUM(VM_ARCH_1);
> +TRACE_DEFINE_ENUM(VM_WIPEONFORK);
> +TRACE_DEFINE_ENUM(VM_DONTDUMP);
> +
> +TRACE_DEFINE_ENUM(VM_SOFTDIRTY);
> +
> +TRACE_DEFINE_ENUM(VM_MIXEDMAP);
> +TRACE_DEFINE_ENUM(VM_HUGEPAGE);
> +TRACE_DEFINE_ENUM(VM_NOHUGEPAGE);
> +TRACE_DEFINE_ENUM(VM_MERGEABLE);
> +
> +#ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
> +TRACE_DEFINE_ENUM(VM_HIGH_ARCH_0);
> +TRACE_DEFINE_ENUM(VM_HIGH_ARCH_1);
> +TRACE_DEFINE_ENUM(VM_HIGH_ARCH_2);
> +TRACE_DEFINE_ENUM(VM_HIGH_ARCH_3);
> +TRACE_DEFINE_ENUM(VM_HIGH_ARCH_4);
> +TRACE_DEFINE_ENUM(VM_HIGH_ARCH_5);
> +TRACE_DEFINE_ENUM(VM_HIGH_ARCH_6);
> +#endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */
> +
>  
>  #ifdef CONFIG_ARCH_HAS_PKEYS
>  # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0
> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> index 2e43c66635a2..04b75d4d01c3 100644
> --- a/rust/bindings/bindings_helper.h
> +++ b/rust/bindings/bindings_helper.h
> @@ -108,7 +108,6 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;
>  
>  const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC = XA_FLAGS_ALLOC;
>  const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC1 = XA_FLAGS_ALLOC1;
> -const vm_flags_t RUST_CONST_HELPER_VM_MERGEABLE = VM_MERGEABLE;
>  
>  #if IS_ENABLED(CONFIG_ANDROID_BINDER_IPC_RUST)
>  #include "../../drivers/android/binder/rust_binder.h"

thanks,
-- 
John Hubbard


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-08 13:15     ` Alice Ryhl
@ 2025-10-10 15:10       ` Darrick J. Wong
  0 siblings, 0 replies; 15+ messages in thread
From: Darrick J. Wong @ 2025-10-10 15:10 UTC (permalink / raw)
  To: Alice Ryhl
  Cc: Jakub Acs, jhubbard, akpm, axelrasmussen, chengming.zhou, david,
	linux-fsdevel, linux-kernel, linux-mm, peterx, rust-for-linux,
	xu.xin16

On Wed, Oct 08, 2025 at 01:15:12PM +0000, Alice Ryhl wrote:
> On Wed, Oct 08, 2025 at 12:54:27PM +0000, Jakub Acs wrote:
> > redefine VM_* flag constants with BIT()
> > 
> > Make VM_* flag constant definitions consistent - unify all to use BIT()
> > macro and define them within an enum.
> > 
> > The bindgen tool is better able to handle BIT(_) declarations when used
> > in an enum.
> > 
> > Also add enum definitions for tracepoints.
> > 
> > We have previously changed VM_MERGEABLE in a separate bugfix. This is a
> > follow-up to make all the VM_* flag constant definitions consistent, as
> > suggested by David in [1].
> > 
> > [1]: https://lore.kernel.org/all/85f852f9-8577-4230-adc7-c52e7f479454@redhat.com/
> > 
> > Signed-off-by: Jakub Acs <acsjakub@amazon.de>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: David Hildenbrand <david@redhat.com>
> > Cc: Xu Xin <xu.xin16@zte.com.cn>
> > Cc: Chengming Zhou <chengming.zhou@linux.dev>
> > Cc: Peter Xu <peterx@redhat.com>
> > Cc: Axel Rasmussen <axelrasmussen@google.com>
> > Cc: linux-mm@kvack.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> > 
> > Hi Alice,
> > 
> > thanks for the patch, I squashed it in (should I add your signed-off-by
> > too?) and added the TRACE_DEFINE_ENUM calls pointed out by Derrick.
> 
> You could add this if you go with the enum approach:
> 
> Co-Developed-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> 
> > I have the following points to still address, though: 
> > 
> > - can the fact that we're not controlling the type of the values if
> >   using enum be a problem? (likely the indirect control we have through
> >   the highest value is good enough, but I'm not sure)
> 
> The compiler should pick the right integer type in this case.
> 
> > - where do TRACE_DEFINE_ENUM calls belong?
> >   I see them placed e.g. in include/trace/misc/nfs.h for nfs or
> >   arch/x86/kvm/mmu/mmutrace.h, but I don't see a corresponding file for
> >   mm.h - does this warrant creating a separate file for these
> >   definitions?
> > 
> > - with the need for TRACE_DEFINE_ENUM calls, do we still deem this
> >   to be a good trade-off? - isn't fixing all of these in
> >   rust/bindings/bindings_helper.h better?
> > 
> > @Derrick, can you point me to how to test for the issue you pointed out?
> 
> I'm not familiar with the TRACE_DEFINE_ENUM unfortunately.

rostedt already filled in the technical details, so I can supply an
example from code in XFS:

$ git grep -E '(XFS_REFC_DOMAIN_COW|XFS_REFC_DOMAIN_STRINGS)' fs/xfs/
fs/xfs/libxfs/xfs_refcount.c:118:               irec->rc_domain = XFS_REFC_DOMAIN_COW;
<snip>
fs/xfs/libxfs/xfs_types.h:164:  XFS_REFC_DOMAIN_COW,
fs/xfs/libxfs/xfs_types.h:167:#define XFS_REFC_DOMAIN_STRINGS \
fs/xfs/libxfs/xfs_types.h:169:  { XFS_REFC_DOMAIN_COW,          "cow" }
<snip>
fs/xfs/xfs_trace.h:1117:TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_COW);
fs/xfs/xfs_trace.h:3635:                  __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),

XFS_REFC_DOMAIN_COW is part of an enumeration:

enum xfs_refc_domain {
	XFS_REFC_DOMAIN_SHARED = 0,
	XFS_REFC_DOMAIN_COW,
};

Which then has a string decoder macro defined for use in
__print_symbolic:

#define XFS_REFC_DOMAIN_STRINGS \
	{ XFS_REFC_DOMAIN_SHARED,	"shared" }, \
	{ XFS_REFC_DOMAIN_COW,		"cow" }

Note the TRACE_DEFINE_ENUM usage in the grep output.

Let's look at one of the tracepoints that uses XFS_REFC_DOMAIN_STRINGS.
The class is xfs_refcount_extent_class, so a relevant tracepoint is
xfs_refcount_get:

# cat /sys/kernel/tracing/events/xfs/xfs_refcount_get/format
name: xfs_refcount_get
ID: 1839
format:
        field:unsigned short common_type;       offset:0;       size:2; signed:0;
        field:unsigned char common_flags;       offset:2;       size:1; signed:0;
        field:unsigned char common_preempt_count;       offset:3;       size:1; signed:0;
        field:int common_pid;   offset:4;       size:4; signed:1;

        field:dev_t dev;        offset:8;       size:4; signed:0;
        field:enum xfs_group_type type; offset:12;      size:1; signed:0;
        field:xfs_agnumber_t agno;      offset:16;      size:4; signed:0;
        field:enum xfs_refc_domain domain;      offset:20;      size:4; signed:0;
        field:xfs_agblock_t startblock; offset:24;      size:4; signed:0;
        field:xfs_extlen_t blockcount;  offset:28;      size:4; signed:0;
        field:xfs_nlink_t refcount;     offset:32;      size:4; signed:0;

print fmt: "dev %d:%d %sno 0x%x dom %s gbno 0x%x fsbcount 0x%x refcount %u", ((unsigned int) ((REC->dev) >> 20)), ((unsigned int) ((REC->dev) & ((1U << 20) - 1))), __print_symbolic(REC->type, { 0, "ag" }, { 1, "rtg" }), REC->agno, __print_symbolic(REC->domain, { 0, "shared" }, { 1, "cow" }), REC->startblock, REC->blockcount, REC->refcount

Notice that the XFS_REFC_DOMAIN_* enumeration values have been
converted into their raw numeric form inside the __print_symbolic
construction so that they're ready for trace-cmd-report.

It's really helpful to have ftrace render bitfield and enumeration
"integers" into something human-readable, especially in filesystems
where there are a lot of those.

--D

> > +#ifndef CONFIG_MMU
> > +TRACE_DEFINE_ENUM(VM_MAYOVERLAY);
> > +#endif /* CONFIG_MMU */
> 
> Here I think you want:
> 
> #ifdef CONFIG_MMU
> TRACE_DEFINE_ENUM(VM_UFFD_MISSING);
> #else
> TRACE_DEFINE_ENUM(VM_MAYOVERLAY);
> #endif /* CONFIG_MMU */
> 
> > +TRACE_DEFINE_ENUM(VM_SOFTDIRTY);
> 
> Here I think you want:
> 
> #ifdef CONFIG_MEM_SOFT_DIRTY
> TRACE_DEFINE_ENUM(VM_SOFTDIRTY);
> #endif
> 
> Alice
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-07 16:21 ` [PATCH] mm: use enum for vm_flags Alice Ryhl
                     ` (2 preceding siblings ...)
  2025-10-08 12:54   ` Jakub Acs
@ 2025-10-10 16:13   ` kernel test robot
  2025-10-11  0:50   ` kernel test robot
  4 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-10-10 16:13 UTC (permalink / raw)
  To: Alice Ryhl, acsjakub
  Cc: oe-kbuild-all, akpm, axelrasmussen, chengming.zhou, david,
	linux-fsdevel, linux-kernel, linux-mm, peterx, xu.xin16,
	rust-for-linux, Alice Ryhl

Hi Alice,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Alice-Ryhl/mm-use-enum-for-vm_flags/20251010-095004
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251007162136.1885546-1-aliceryhl%40google.com
patch subject: [PATCH] mm: use enum for vm_flags
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20251011/202510110039.N3gHQwXj-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251011/202510110039.N3gHQwXj-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510110039.N3gHQwXj-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/pagewalk.h:5,
                    from fs/proc/task_mmu.c:2:
   fs/proc/task_mmu.c: In function 'show_smap_vma_flags':
>> include/linux/mm.h:353:24: warning: "VM_HIGH_ARCH_3" is not defined, evaluates to 0 [-Wundef]
     353 | # define VM_PKEY_BIT3  VM_HIGH_ARCH_3
         |                        ^~~~~~~~~~~~~~
   fs/proc/task_mmu.c:1184:5: note: in expansion of macro 'VM_PKEY_BIT3'
    1184 | #if VM_PKEY_BIT3
         |     ^~~~~~~~~~~~


vim +/VM_HIGH_ARCH_3 +353 include/linux/mm.h

63c17fb8e5a46a Dave Hansen 2016-02-12  346  
5212213aa5a235 Ram Pai     2018-03-27  347  #ifdef CONFIG_ARCH_HAS_PKEYS
8f62c883222c9e Dave Hansen 2016-02-12  348  # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0
9f82f15ddfdd60 Joey Gouly  2024-08-22  349  # define VM_PKEY_BIT0  VM_HIGH_ARCH_0
9f82f15ddfdd60 Joey Gouly  2024-08-22  350  # define VM_PKEY_BIT1  VM_HIGH_ARCH_1
8f62c883222c9e Dave Hansen 2016-02-12  351  # define VM_PKEY_BIT2  VM_HIGH_ARCH_2
9f82f15ddfdd60 Joey Gouly  2024-08-22  352  #if CONFIG_ARCH_PKEY_BITS > 3
8f62c883222c9e Dave Hansen 2016-02-12 @353  # define VM_PKEY_BIT3  VM_HIGH_ARCH_3
9f82f15ddfdd60 Joey Gouly  2024-08-22  354  #else
9f82f15ddfdd60 Joey Gouly  2024-08-22  355  # define VM_PKEY_BIT3  0
9f82f15ddfdd60 Joey Gouly  2024-08-22  356  #endif
9f82f15ddfdd60 Joey Gouly  2024-08-22  357  #if CONFIG_ARCH_PKEY_BITS > 4
2c9e0a6fa2bb75 Ram Pai     2018-03-27  358  # define VM_PKEY_BIT4  VM_HIGH_ARCH_4
2c9e0a6fa2bb75 Ram Pai     2018-03-27  359  #else
2c9e0a6fa2bb75 Ram Pai     2018-03-27  360  # define VM_PKEY_BIT4  0
8f62c883222c9e Dave Hansen 2016-02-12  361  #endif
5212213aa5a235 Ram Pai     2018-03-27  362  #endif /* CONFIG_ARCH_HAS_PKEYS */
5212213aa5a235 Ram Pai     2018-03-27  363  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-08 12:54   ` Jakub Acs
                       ` (2 preceding siblings ...)
  2025-10-09  2:33     ` John Hubbard
@ 2025-10-11  0:18     ` kernel test robot
  2025-10-11  0:39     ` kernel test robot
  4 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-10-11  0:18 UTC (permalink / raw)
  To: Jakub Acs, aliceryhl, djwong
  Cc: oe-kbuild-all, jhubbard, acsjakub, akpm, axelrasmussen,
	chengming.zhou, david, linux-fsdevel, linux-kernel, linux-mm,
	peterx, rust-for-linux, xu.xin16

Hi Jakub,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Acs/mm-use-enum-for-vm_flags/20251010-124738
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251008125427.68735-1-acsjakub%40amazon.de
patch subject: [PATCH] mm: use enum for vm_flags
config: s390-randconfig-001-20251011 (https://download.01.org/0day-ci/archive/20251011/202510110743.9G4osLTr-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 9.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251011/202510110743.9G4osLTr-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510110743.9G4osLTr-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from arch/s390/include/asm/mmu_context.h:11,
                    from arch/s390/include/asm/elf.h:178,
                    from include/linux/elf.h:6,
                    from include/linux/module.h:20,
                    from include/linux/device/driver.h:21,
                    from include/linux/device.h:32,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/static_call.h:135,
                    from include/linux/tracepoint.h:22,
                    from include/linux/mm.h:39,
                    from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
   arch/s390/include/asm/pgalloc.h: In function 'p4d_alloc_one_noprof':
>> arch/s390/include/asm/pgalloc.h:62:2: error: implicit declaration of function 'pagetable_p4d_ctor' [-Werror=implicit-function-declaration]
      62 |  pagetable_p4d_ctor(virt_to_ptdesc(table));
         |  ^~~~~~~~~~~~~~~~~~
>> arch/s390/include/asm/pgalloc.h:62:21: error: implicit declaration of function 'virt_to_ptdesc'; did you mean 'virt_to_kpte'? [-Werror=implicit-function-declaration]
      62 |  pagetable_p4d_ctor(virt_to_ptdesc(table));
         |                     ^~~~~~~~~~~~~~
         |                     virt_to_kpte
   arch/s390/include/asm/pgalloc.h: In function 'p4d_free':
>> arch/s390/include/asm/pgalloc.h:73:2: error: implicit declaration of function 'pagetable_dtor'; did you mean 'page_table_free'? [-Werror=implicit-function-declaration]
      73 |  pagetable_dtor(virt_to_ptdesc(p4d));
         |  ^~~~~~~~~~~~~~
         |  page_table_free
   arch/s390/include/asm/pgalloc.h: In function 'pud_alloc_one_noprof':
>> arch/s390/include/asm/pgalloc.h:84:2: error: implicit declaration of function 'pagetable_pud_ctor' [-Werror=implicit-function-declaration]
      84 |  pagetable_pud_ctor(virt_to_ptdesc(table));
         |  ^~~~~~~~~~~~~~~~~~
   arch/s390/include/asm/pgalloc.h: In function 'pmd_alloc_one_noprof':
>> arch/s390/include/asm/pgalloc.h:106:7: error: implicit declaration of function 'pagetable_pmd_ctor' [-Werror=implicit-function-declaration]
     106 |  if (!pagetable_pmd_ctor(mm, virt_to_ptdesc(table))) {
         |       ^~~~~~~~~~~~~~~~~~
   arch/s390/include/asm/pgalloc.h: In function 'pgd_alloc_noprof':
>> arch/s390/include/asm/pgalloc.h:143:2: error: implicit declaration of function 'pagetable_pgd_ctor' [-Werror=implicit-function-declaration]
     143 |  pagetable_pgd_ctor(virt_to_ptdesc(table));
         |  ^~~~~~~~~~~~~~~~~~
   In file included from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
   include/linux/mm.h: At top level:
>> include/linux/mm.h:3011:30: error: conflicting types for 'virt_to_ptdesc'
    3011 | static inline struct ptdesc *virt_to_ptdesc(const void *x)
         |                              ^~~~~~~~~~~~~~
   In file included from arch/s390/include/asm/mmu_context.h:11,
                    from arch/s390/include/asm/elf.h:178,
                    from include/linux/elf.h:6,
                    from include/linux/module.h:20,
                    from include/linux/device/driver.h:21,
                    from include/linux/device.h:32,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/static_call.h:135,
                    from include/linux/tracepoint.h:22,
                    from include/linux/mm.h:39,
                    from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
   arch/s390/include/asm/pgalloc.h:62:21: note: previous implicit declaration of 'virt_to_ptdesc' was here
      62 |  pagetable_p4d_ctor(virt_to_ptdesc(table));
         |                     ^~~~~~~~~~~~~~
   In file included from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
>> include/linux/mm.h:3152:20: warning: conflicting types for 'pagetable_dtor'
    3152 | static inline void pagetable_dtor(struct ptdesc *ptdesc)
         |                    ^~~~~~~~~~~~~~
>> include/linux/mm.h:3152:20: error: static declaration of 'pagetable_dtor' follows non-static declaration
   In file included from arch/s390/include/asm/mmu_context.h:11,
                    from arch/s390/include/asm/elf.h:178,
                    from include/linux/elf.h:6,
                    from include/linux/module.h:20,
                    from include/linux/device/driver.h:21,
                    from include/linux/device.h:32,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/static_call.h:135,
                    from include/linux/tracepoint.h:22,
                    from include/linux/mm.h:39,
                    from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
   arch/s390/include/asm/pgalloc.h:73:2: note: previous implicit declaration of 'pagetable_dtor' was here
      73 |  pagetable_dtor(virt_to_ptdesc(p4d));
         |  ^~~~~~~~~~~~~~
   In file included from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
>> include/linux/mm.h:3274:20: error: conflicting types for 'pagetable_pmd_ctor'
    3274 | static inline bool pagetable_pmd_ctor(struct mm_struct *mm,
         |                    ^~~~~~~~~~~~~~~~~~
   In file included from arch/s390/include/asm/mmu_context.h:11,
                    from arch/s390/include/asm/elf.h:178,
                    from include/linux/elf.h:6,
                    from include/linux/module.h:20,
                    from include/linux/device/driver.h:21,
                    from include/linux/device.h:32,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/static_call.h:135,
                    from include/linux/tracepoint.h:22,
                    from include/linux/mm.h:39,
                    from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
   arch/s390/include/asm/pgalloc.h:106:7: note: previous implicit declaration of 'pagetable_pmd_ctor' was here
     106 |  if (!pagetable_pmd_ctor(mm, virt_to_ptdesc(table))) {
         |       ^~~~~~~~~~~~~~~~~~
   In file included from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
>> include/linux/mm.h:3303:20: warning: conflicting types for 'pagetable_pud_ctor'
    3303 | static inline void pagetable_pud_ctor(struct ptdesc *ptdesc)
         |                    ^~~~~~~~~~~~~~~~~~
>> include/linux/mm.h:3303:20: error: static declaration of 'pagetable_pud_ctor' follows non-static declaration
   In file included from arch/s390/include/asm/mmu_context.h:11,
                    from arch/s390/include/asm/elf.h:178,
                    from include/linux/elf.h:6,
                    from include/linux/module.h:20,
                    from include/linux/device/driver.h:21,
                    from include/linux/device.h:32,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/static_call.h:135,
                    from include/linux/tracepoint.h:22,
                    from include/linux/mm.h:39,
                    from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
   arch/s390/include/asm/pgalloc.h:84:2: note: previous implicit declaration of 'pagetable_pud_ctor' was here
      84 |  pagetable_pud_ctor(virt_to_ptdesc(table));
         |  ^~~~~~~~~~~~~~~~~~
   In file included from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
>> include/linux/mm.h:3308:20: warning: conflicting types for 'pagetable_p4d_ctor'
    3308 | static inline void pagetable_p4d_ctor(struct ptdesc *ptdesc)
         |                    ^~~~~~~~~~~~~~~~~~
>> include/linux/mm.h:3308:20: error: static declaration of 'pagetable_p4d_ctor' follows non-static declaration
   In file included from arch/s390/include/asm/mmu_context.h:11,
                    from arch/s390/include/asm/elf.h:178,
                    from include/linux/elf.h:6,
                    from include/linux/module.h:20,
                    from include/linux/device/driver.h:21,
                    from include/linux/device.h:32,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/static_call.h:135,
                    from include/linux/tracepoint.h:22,
                    from include/linux/mm.h:39,
                    from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
   arch/s390/include/asm/pgalloc.h:62:2: note: previous implicit declaration of 'pagetable_p4d_ctor' was here
      62 |  pagetable_p4d_ctor(virt_to_ptdesc(table));
         |  ^~~~~~~~~~~~~~~~~~
   In file included from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
>> include/linux/mm.h:3313:20: warning: conflicting types for 'pagetable_pgd_ctor'
    3313 | static inline void pagetable_pgd_ctor(struct ptdesc *ptdesc)
         |                    ^~~~~~~~~~~~~~~~~~
>> include/linux/mm.h:3313:20: error: static declaration of 'pagetable_pgd_ctor' follows non-static declaration
   In file included from arch/s390/include/asm/mmu_context.h:11,
                    from arch/s390/include/asm/elf.h:178,
                    from include/linux/elf.h:6,
                    from include/linux/module.h:20,
                    from include/linux/device/driver.h:21,
                    from include/linux/device.h:32,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/static_call.h:135,
                    from include/linux/tracepoint.h:22,
                    from include/linux/mm.h:39,
                    from include/linux/pid_namespace.h:7,
                    from include/linux/ptrace.h:10,
                    from arch/s390/include/asm/stacktrace.h:7,
                    from arch/s390/kernel/asm-offsets.c:15:
   arch/s390/include/asm/pgalloc.h:143:2: note: previous implicit declaration of 'pagetable_pgd_ctor' was here
     143 |  pagetable_pgd_ctor(virt_to_ptdesc(table));
         |  ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
   make[3]: *** [scripts/Makefile.build:182: arch/s390/kernel/asm-offsets.s] Error 1 shuffle=2098624972
   make[3]: Target 'prepare' not remade because of errors.
   make[2]: *** [Makefile:1280: prepare0] Error 2 shuffle=2098624972
   make[2]: Target 'prepare' not remade because of errors.
   make[1]: *** [Makefile:248: __sub-make] Error 2 shuffle=2098624972
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:248: __sub-make] Error 2 shuffle=2098624972
   make: Target 'prepare' not remade because of errors.


vim +/virt_to_ptdesc +3011 include/linux/mm.h

522abd92279a8e Matthew Wilcox (Oracle  2025-09-08  3010) 
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07 @3011) static inline struct ptdesc *virt_to_ptdesc(const void *x)
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3012) {
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3013) 	return page_ptdesc(virt_to_page(x));
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3014) }
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3015) 
90ec2df9dd3165 Matthew Wilcox (Oracle  2025-09-08  3016) /**
90ec2df9dd3165 Matthew Wilcox (Oracle  2025-09-08  3017)  * ptdesc_address - Virtual address of page table.
90ec2df9dd3165 Matthew Wilcox (Oracle  2025-09-08  3018)  * @pt: Page table descriptor.
90ec2df9dd3165 Matthew Wilcox (Oracle  2025-09-08  3019)  *
90ec2df9dd3165 Matthew Wilcox (Oracle  2025-09-08  3020)  * Return: The first byte of the page table described by @pt.
90ec2df9dd3165 Matthew Wilcox (Oracle  2025-09-08  3021)  */
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3022) static inline void *ptdesc_address(const struct ptdesc *pt)
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3023) {
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3024) 	return folio_address(ptdesc_folio(pt));
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3025) }
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3026) 
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3027) static inline bool pagetable_is_reserved(struct ptdesc *pt)
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3028) {
522abd92279a8e Matthew Wilcox (Oracle  2025-09-08  3029) 	return test_bit(PT_reserved, &pt->pt_flags.f);
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3030) }
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3031) 
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3032) /**
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3033)  * pagetable_alloc - Allocate pagetables
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3034)  * @gfp:    GFP flags
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3035)  * @order:  desired pagetable order
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3036)  *
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3037)  * pagetable_alloc allocates memory for page tables as well as a page table
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3038)  * descriptor to describe that memory.
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3039)  *
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3040)  * Return: The ptdesc describing the allocated page tables.
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3041)  */
2c321f3f70bc28 Suren Baghdasaryan      2024-04-14  3042  static inline struct ptdesc *pagetable_alloc_noprof(gfp_t gfp, unsigned int order)
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3043) {
2c321f3f70bc28 Suren Baghdasaryan      2024-04-14  3044  	struct page *page = alloc_pages_noprof(gfp | __GFP_COMP, order);
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3045) 
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3046) 	return page_ptdesc(page);
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3047) }
2c321f3f70bc28 Suren Baghdasaryan      2024-04-14  3048  #define pagetable_alloc(...)	alloc_hooks(pagetable_alloc_noprof(__VA_ARGS__))
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3049) 
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3050) /**
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3051)  * pagetable_free - Free pagetables
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3052)  * @pt:	The page table descriptor
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3053)  *
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3054)  * pagetable_free frees the memory of all page tables described by a page
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3055)  * table descriptor and the memory for the descriptor itself.
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3056)  */
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3057) static inline void pagetable_free(struct ptdesc *pt)
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3058) {
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3059) 	struct page *page = ptdesc_page(pt);
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3060) 
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3061) 	__free_pages(page, compound_order(page));
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3062) }
bf2d4334f72e4e Vishal Moola (Oracle    2023-08-07  3063) 
394290cba9664e David Hildenbrand       2024-07-26  3064  #if defined(CONFIG_SPLIT_PTE_PTLOCKS)
597d795a2a786d Kirill A. Shutemov      2013-12-20  3065  #if ALLOC_SPLIT_PTLOCKS
b35f1819acd924 Kirill A. Shutemov      2014-01-21  3066  void __init ptlock_cache_init(void);
f5ecca06b3a5d0 Vishal Moola (Oracle    2023-08-07  3067) bool ptlock_alloc(struct ptdesc *ptdesc);
6ed1b8a09deb0b Vishal Moola (Oracle    2023-08-07  3068) void ptlock_free(struct ptdesc *ptdesc);
539edb5846c740 Peter Zijlstra          2013-11-14  3069  
1865484af6b2ce Vishal Moola (Oracle    2023-08-07  3070) static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc)
539edb5846c740 Peter Zijlstra          2013-11-14  3071  {
1865484af6b2ce Vishal Moola (Oracle    2023-08-07  3072) 	return ptdesc->ptl;
539edb5846c740 Peter Zijlstra          2013-11-14  3073  }
597d795a2a786d Kirill A. Shutemov      2013-12-20  3074  #else /* ALLOC_SPLIT_PTLOCKS */
b35f1819acd924 Kirill A. Shutemov      2014-01-21  3075  static inline void ptlock_cache_init(void)
b35f1819acd924 Kirill A. Shutemov      2014-01-21  3076  {
b35f1819acd924 Kirill A. Shutemov      2014-01-21  3077  }
b35f1819acd924 Kirill A. Shutemov      2014-01-21  3078  
f5ecca06b3a5d0 Vishal Moola (Oracle    2023-08-07  3079) static inline bool ptlock_alloc(struct ptdesc *ptdesc)
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3080  {
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3081  	return true;
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3082  }
539edb5846c740 Peter Zijlstra          2013-11-14  3083  
6ed1b8a09deb0b Vishal Moola (Oracle    2023-08-07  3084) static inline void ptlock_free(struct ptdesc *ptdesc)
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3085  {
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3086  }
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3087  
1865484af6b2ce Vishal Moola (Oracle    2023-08-07  3088) static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc)
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3089  {
1865484af6b2ce Vishal Moola (Oracle    2023-08-07  3090) 	return &ptdesc->ptl;
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3091  }
597d795a2a786d Kirill A. Shutemov      2013-12-20  3092  #endif /* ALLOC_SPLIT_PTLOCKS */
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3093  
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3094  static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3095  {
1865484af6b2ce Vishal Moola (Oracle    2023-08-07  3096) 	return ptlock_ptr(page_ptdesc(pmd_page(*pmd)));
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3097  }
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3098  
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3099  static inline spinlock_t *ptep_lockptr(struct mm_struct *mm, pte_t *pte)
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3100  {
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3101  	BUILD_BUG_ON(IS_ENABLED(CONFIG_HIGHPTE));
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3102  	BUILD_BUG_ON(MAX_PTRS_PER_PTE * sizeof(pte_t) > PAGE_SIZE);
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3103  	return ptlock_ptr(virt_to_ptdesc(pte));
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3104  }
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3105  
75b25d49ca6638 Vishal Moola (Oracle    2023-08-07  3106) static inline bool ptlock_init(struct ptdesc *ptdesc)
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3107  {
4c21e2f2441dc5 Hugh Dickins            2005-10-29  3108  	/*
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3109  	 * prep_new_page() initialize page->private (and therefore page->ptl)
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3110  	 * with 0. Make sure nobody took it in use in between.
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3111  	 *
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3112  	 * It can happen if arch try to use slab for page table allocation:
1d798ca3f16437 Kirill A. Shutemov      2015-11-06  3113  	 * slab code uses page->slab_cache, which share storage with page->ptl.
4c21e2f2441dc5 Hugh Dickins            2005-10-29  3114  	 */
75b25d49ca6638 Vishal Moola (Oracle    2023-08-07  3115) 	VM_BUG_ON_PAGE(*(unsigned long *)&ptdesc->ptl, ptdesc_page(ptdesc));
75b25d49ca6638 Vishal Moola (Oracle    2023-08-07  3116) 	if (!ptlock_alloc(ptdesc))
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3117  		return false;
75b25d49ca6638 Vishal Moola (Oracle    2023-08-07  3118) 	spin_lock_init(ptlock_ptr(ptdesc));
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3119  	return true;
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3120  }
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3121  
394290cba9664e David Hildenbrand       2024-07-26  3122  #else	/* !defined(CONFIG_SPLIT_PTE_PTLOCKS) */
4c21e2f2441dc5 Hugh Dickins            2005-10-29  3123  /*
4c21e2f2441dc5 Hugh Dickins            2005-10-29  3124   * We use mm->page_table_lock to guard all pagetable pages of the mm.
4c21e2f2441dc5 Hugh Dickins            2005-10-29  3125   */
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3126  static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3127  {
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3128  	return &mm->page_table_lock;
49076ec2ccaf68 Kirill A. Shutemov      2013-11-14  3129  }
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3130  static inline spinlock_t *ptep_lockptr(struct mm_struct *mm, pte_t *pte)
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3131  {
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3132  	return &mm->page_table_lock;
5f75cfbd6bb022 David Hildenbrand       2024-08-01  3133  }
b35f1819acd924 Kirill A. Shutemov      2014-01-21  3134  static inline void ptlock_cache_init(void) {}
75b25d49ca6638 Vishal Moola (Oracle    2023-08-07  3135) static inline bool ptlock_init(struct ptdesc *ptdesc) { return true; }
6ed1b8a09deb0b Vishal Moola (Oracle    2023-08-07  3136) static inline void ptlock_free(struct ptdesc *ptdesc) {}
394290cba9664e David Hildenbrand       2024-07-26  3137  #endif /* defined(CONFIG_SPLIT_PTE_PTLOCKS) */
4c21e2f2441dc5 Hugh Dickins            2005-10-29  3138  
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3139) static inline unsigned long ptdesc_nr_pages(const struct ptdesc *ptdesc)
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3140) {
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3141) 	return compound_nr(ptdesc_page(ptdesc));
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3142) }
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3143) 
11e2400b21a3e2 Kevin Brodsky           2025-01-03  3144  static inline void __pagetable_ctor(struct ptdesc *ptdesc)
2f569afd9ced9e Martin Schwidefsky      2008-02-08  3145  {
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3146) 	pg_data_t *pgdat = NODE_DATA(memdesc_nid(ptdesc->pt_flags));
7e11dca14b27e1 Vishal Moola (Oracle    2023-08-07  3147) 
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3148) 	__SetPageTable(ptdesc_page(ptdesc));
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3149) 	mod_node_page_state(pgdat, NR_PAGETABLE, ptdesc_nr_pages(ptdesc));
2f569afd9ced9e Martin Schwidefsky      2008-02-08  3150  }
2f569afd9ced9e Martin Schwidefsky      2008-02-08  3151  
db6b435d731a8d Qi Zheng                2025-01-08 @3152  static inline void pagetable_dtor(struct ptdesc *ptdesc)
7e11dca14b27e1 Vishal Moola (Oracle    2023-08-07  3153) {
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3154) 	pg_data_t *pgdat = NODE_DATA(memdesc_nid(ptdesc->pt_flags));
7e11dca14b27e1 Vishal Moola (Oracle    2023-08-07  3155) 
7e11dca14b27e1 Vishal Moola (Oracle    2023-08-07  3156) 	ptlock_free(ptdesc);
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3157) 	__ClearPageTable(ptdesc_page(ptdesc));
f0c92726e89f5c Matthew Wilcox (Oracle  2025-09-08  3158) 	mod_node_page_state(pgdat, NR_PAGETABLE, -ptdesc_nr_pages(ptdesc));
7e11dca14b27e1 Vishal Moola (Oracle    2023-08-07  3159) }
7e11dca14b27e1 Vishal Moola (Oracle    2023-08-07  3160) 

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-08 12:54   ` Jakub Acs
                       ` (3 preceding siblings ...)
  2025-10-11  0:18     ` kernel test robot
@ 2025-10-11  0:39     ` kernel test robot
  4 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-10-11  0:39 UTC (permalink / raw)
  To: Jakub Acs, aliceryhl, djwong
  Cc: oe-kbuild-all, jhubbard, acsjakub, akpm, axelrasmussen,
	chengming.zhou, david, linux-fsdevel, linux-kernel, linux-mm,
	peterx, rust-for-linux, xu.xin16

Hi Jakub,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Acs/mm-use-enum-for-vm_flags/20251010-124738
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251008125427.68735-1-acsjakub%40amazon.de
patch subject: [PATCH] mm: use enum for vm_flags
config: parisc-randconfig-r072-20251011 (https://download.01.org/0day-ci/archive/20251011/202510110802.EXLvwqhL-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251011/202510110802.EXLvwqhL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510110802.EXLvwqhL-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/elf.h:6,
                    from include/linux/module.h:20,
                    from include/linux/device/driver.h:21,
                    from include/linux/device.h:32,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/static_call.h:135,
                    from include/linux/tracepoint.h:22,
                    from include/linux/mm.h:39,
                    from include/linux/pid_namespace.h:7,
                    from include/linux/nsfs.h:9,
                    from include/linux/proc_ns.h:8,
                    from init/version.c:18:
>> arch/parisc/include/asm/elf.h:320: warning: "ELF_OSABI" redefined
    #define ELF_OSABI  ELFOSABI_LINUX
    
   In file included from include/linux/elfnote.h:62,
                    from include/linux/build-salt.h:4,
                    from init/version.c:11:
   include/uapi/linux/elf.h:386: note: this is the location of the previous definition
    #define ELF_OSABI ELFOSABI_NONE
    


vim +/ELF_OSABI +320 arch/parisc/include/asm/elf.h

^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  308  
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  309  
71d577db01a517 arch/parisc/include/asm/elf.h Helge Deller   2018-04-11  310  #define elf_check_arch(x)		\
71d577db01a517 arch/parisc/include/asm/elf.h Helge Deller   2018-04-11  311  	((x)->e_machine == EM_PARISC && (x)->e_ident[EI_CLASS] == ELF_CLASS)
71d577db01a517 arch/parisc/include/asm/elf.h Helge Deller   2018-04-11  312  #define compat_elf_check_arch(x)	\
71d577db01a517 arch/parisc/include/asm/elf.h Helge Deller   2018-04-11  313  	((x)->e_machine == EM_PARISC && (x)->e_ident[EI_CLASS] == ELFCLASS32)
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  314  
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  315  /*
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  316   * These are used to set parameters in the core dumps.
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  317   */
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  318  #define ELF_DATA	ELFDATA2MSB
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  319  #define ELF_ARCH	EM_PARISC
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16 @320  #define ELF_OSABI 	ELFOSABI_LINUX
^1da177e4c3f41 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  321  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] mm: use enum for vm_flags
  2025-10-07 16:21 ` [PATCH] mm: use enum for vm_flags Alice Ryhl
                     ` (3 preceding siblings ...)
  2025-10-10 16:13   ` kernel test robot
@ 2025-10-11  0:50   ` kernel test robot
  4 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-10-11  0:50 UTC (permalink / raw)
  To: Alice Ryhl, acsjakub
  Cc: oe-kbuild-all, akpm, axelrasmussen, chengming.zhou, david,
	linux-fsdevel, linux-kernel, linux-mm, peterx, xu.xin16,
	rust-for-linux, Alice Ryhl

Hi Alice,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Alice-Ryhl/mm-use-enum-for-vm_flags/20251010-095004
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251007162136.1885546-1-aliceryhl%40google.com
patch subject: [PATCH] mm: use enum for vm_flags
config: powerpc64-randconfig-r111-20251011 (https://download.01.org/0day-ci/archive/20251011/202510110850.4VXzbsF7-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251011/202510110850.4VXzbsF7-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510110850.4VXzbsF7-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/proc/task_mmu.c:1184:5: sparse: sparse: undefined preprocessor identifier 'VM_HIGH_ARCH_3'
>> fs/proc/task_mmu.c:1187:5: sparse: sparse: undefined preprocessor identifier 'VM_HIGH_ARCH_4'
   fs/proc/task_mmu.c: note: in included file (through include/linux/rbtree.h, include/linux/mm_types.h, include/linux/mmzone.h, ...):
   include/linux/rcupdate.h:897:25: sparse: sparse: context imbalance in 'proc_get_vma' - unexpected unlock
   fs/proc/task_mmu.c:309:9: sparse: sparse: context imbalance in 'm_start' - different lock contexts for basic block
   include/linux/rcupdate.h:897:25: sparse: sparse: context imbalance in 'm_stop' - unexpected unlock

vim +/VM_HIGH_ARCH_3 +1184 fs/proc/task_mmu.c

e070ad49f31155 Mauricio Lin       2005-09-03  1120  
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1121  static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1122  {
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1123  	/*
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1124  	 * Don't forget to update Documentation/ on changes.
5778ace04e6f07 Brahmajit Das      2024-10-05  1125  	 *
5778ace04e6f07 Brahmajit Das      2024-10-05  1126  	 * The length of the second argument of mnemonics[]
5778ace04e6f07 Brahmajit Das      2024-10-05  1127  	 * needs to be 3 instead of previously set 2
5778ace04e6f07 Brahmajit Das      2024-10-05  1128  	 * (i.e. from [BITS_PER_LONG][2] to [BITS_PER_LONG][3])
5778ace04e6f07 Brahmajit Das      2024-10-05  1129  	 * to avoid spurious
5778ace04e6f07 Brahmajit Das      2024-10-05  1130  	 * -Werror=unterminated-string-initialization warning
5778ace04e6f07 Brahmajit Das      2024-10-05  1131  	 *  with GCC 15
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1132  	 */
5778ace04e6f07 Brahmajit Das      2024-10-05  1133  	static const char mnemonics[BITS_PER_LONG][3] = {
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1134  		/*
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1135  		 * In case if we meet a flag we don't know about.
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1136  		 */
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1137  		[0 ... (BITS_PER_LONG-1)] = "??",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1138  
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1139  		[ilog2(VM_READ)]	= "rd",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1140  		[ilog2(VM_WRITE)]	= "wr",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1141  		[ilog2(VM_EXEC)]	= "ex",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1142  		[ilog2(VM_SHARED)]	= "sh",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1143  		[ilog2(VM_MAYREAD)]	= "mr",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1144  		[ilog2(VM_MAYWRITE)]	= "mw",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1145  		[ilog2(VM_MAYEXEC)]	= "me",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1146  		[ilog2(VM_MAYSHARE)]	= "ms",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1147  		[ilog2(VM_GROWSDOWN)]	= "gd",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1148  		[ilog2(VM_PFNMAP)]	= "pf",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1149  		[ilog2(VM_LOCKED)]	= "lo",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1150  		[ilog2(VM_IO)]		= "io",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1151  		[ilog2(VM_SEQ_READ)]	= "sr",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1152  		[ilog2(VM_RAND_READ)]	= "rr",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1153  		[ilog2(VM_DONTCOPY)]	= "dc",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1154  		[ilog2(VM_DONTEXPAND)]	= "de",
8614d6c5eda005 Jason A. Donenfeld 2022-12-05  1155  		[ilog2(VM_LOCKONFAULT)]	= "lf",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1156  		[ilog2(VM_ACCOUNT)]	= "ac",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1157  		[ilog2(VM_NORESERVE)]	= "nr",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1158  		[ilog2(VM_HUGETLB)]	= "ht",
b6fb293f2497a9 Jan Kara           2017-11-01  1159  		[ilog2(VM_SYNC)]	= "sf",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1160  		[ilog2(VM_ARCH_1)]	= "ar",
d2cd9ede6e193d Rik van Riel       2017-09-06  1161  		[ilog2(VM_WIPEONFORK)]	= "wf",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1162  		[ilog2(VM_DONTDUMP)]	= "dd",
424037b77519d1 Daniel Kiss        2020-03-16  1163  #ifdef CONFIG_ARM64_BTI
424037b77519d1 Daniel Kiss        2020-03-16  1164  		[ilog2(VM_ARM64_BTI)]	= "bt",
424037b77519d1 Daniel Kiss        2020-03-16  1165  #endif
ec8e41aec13005 Naoya Horiguchi    2013-11-12  1166  #ifdef CONFIG_MEM_SOFT_DIRTY
ec8e41aec13005 Naoya Horiguchi    2013-11-12  1167  		[ilog2(VM_SOFTDIRTY)]	= "sd",
ec8e41aec13005 Naoya Horiguchi    2013-11-12  1168  #endif
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1169  		[ilog2(VM_MIXEDMAP)]	= "mm",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1170  		[ilog2(VM_HUGEPAGE)]	= "hg",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1171  		[ilog2(VM_NOHUGEPAGE)]	= "nh",
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1172  		[ilog2(VM_MERGEABLE)]	= "mg",
16ba6f811dfe44 Andrea Arcangeli   2015-09-04  1173  		[ilog2(VM_UFFD_MISSING)]= "um",
16ba6f811dfe44 Andrea Arcangeli   2015-09-04  1174  		[ilog2(VM_UFFD_WP)]	= "uw",
9f3419315f3cdc Catalin Marinas    2019-11-27  1175  #ifdef CONFIG_ARM64_MTE
9f3419315f3cdc Catalin Marinas    2019-11-27  1176  		[ilog2(VM_MTE)]		= "mt",
9f3419315f3cdc Catalin Marinas    2019-11-27  1177  		[ilog2(VM_MTE_ALLOWED)]	= "",
9f3419315f3cdc Catalin Marinas    2019-11-27  1178  #endif
5212213aa5a235 Ram Pai            2018-03-27  1179  #ifdef CONFIG_ARCH_HAS_PKEYS
c1192f84284146 Dave Hansen        2016-02-12  1180  		/* These come out via ProtectionKey: */
c1192f84284146 Dave Hansen        2016-02-12  1181  		[ilog2(VM_PKEY_BIT0)]	= "",
c1192f84284146 Dave Hansen        2016-02-12  1182  		[ilog2(VM_PKEY_BIT1)]	= "",
c1192f84284146 Dave Hansen        2016-02-12  1183  		[ilog2(VM_PKEY_BIT2)]	= "",
9f82f15ddfdd60 Joey Gouly         2024-08-22 @1184  #if VM_PKEY_BIT3
c1192f84284146 Dave Hansen        2016-02-12  1185  		[ilog2(VM_PKEY_BIT3)]	= "",
9f82f15ddfdd60 Joey Gouly         2024-08-22  1186  #endif
2c9e0a6fa2bb75 Ram Pai            2018-03-27 @1187  #if VM_PKEY_BIT4
2c9e0a6fa2bb75 Ram Pai            2018-03-27  1188  		[ilog2(VM_PKEY_BIT4)]	= "",
c1192f84284146 Dave Hansen        2016-02-12  1189  #endif
5212213aa5a235 Ram Pai            2018-03-27  1190  #endif /* CONFIG_ARCH_HAS_PKEYS */
7677f7fd8be766 Axel Rasmussen     2021-05-04  1191  #ifdef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR
7677f7fd8be766 Axel Rasmussen     2021-05-04  1192  		[ilog2(VM_UFFD_MINOR)]	= "ui",
7677f7fd8be766 Axel Rasmussen     2021-05-04  1193  #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */
bcc9d04e749a8c Mark Brown         2024-10-01  1194  #ifdef CONFIG_ARCH_HAS_USER_SHADOW_STACK
54007f818206dc Yu-cheng Yu        2023-06-12  1195  		[ilog2(VM_SHADOW_STACK)] = "ss",
399ab86ea55039 Jeff Xu            2024-06-14  1196  #endif
d175ee98fe545d Christophe Leroy   2024-09-02  1197  #if defined(CONFIG_64BIT) || defined(CONFIG_PPC32)
9651fcedf7b92d Jason A. Donenfeld 2022-12-08  1198  		[ilog2(VM_DROPPABLE)] = "dp",
d175ee98fe545d Christophe Leroy   2024-09-02  1199  #endif
d175ee98fe545d Christophe Leroy   2024-09-02  1200  #ifdef CONFIG_64BIT
399ab86ea55039 Jeff Xu            2024-06-14  1201  		[ilog2(VM_SEALED)] = "sl",
54007f818206dc Yu-cheng Yu        2023-06-12  1202  #endif
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1203  	};
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1204  	size_t i;
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1205  
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1206  	seq_puts(m, "VmFlags: ");
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1207  	for (i = 0; i < BITS_PER_LONG; i++) {
c1192f84284146 Dave Hansen        2016-02-12  1208  		if (!mnemonics[i][0])
c1192f84284146 Dave Hansen        2016-02-12  1209  			continue;
5778ace04e6f07 Brahmajit Das      2024-10-05  1210  		if (vma->vm_flags & (1UL << i))
5778ace04e6f07 Brahmajit Das      2024-10-05  1211  			seq_printf(m, "%s ", mnemonics[i]);
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1212  	}
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1213  	seq_putc(m, '\n');
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1214  }
834f82e2aa9a8e Cyrill Gorcunov    2012-12-17  1215  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-10-11  0:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02  7:52 [PATCH v4] mm: redefine VM_* flag constants with BIT() Jakub Acs
2025-10-02  7:54 ` David Hildenbrand
2025-10-02 17:43 ` SeongJae Park
2025-10-07 16:21 ` [PATCH] mm: use enum for vm_flags Alice Ryhl
2025-10-07 17:01   ` Darrick J. Wong
2025-10-08  2:36   ` John Hubbard
2025-10-08 12:54   ` Jakub Acs
2025-10-08 13:15     ` Alice Ryhl
2025-10-10 15:10       ` Darrick J. Wong
2025-10-08 14:17     ` Steven Rostedt
2025-10-09  2:33     ` John Hubbard
2025-10-11  0:18     ` kernel test robot
2025-10-11  0:39     ` kernel test robot
2025-10-10 16:13   ` kernel test robot
2025-10-11  0:50   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).