Re: [PATCH 1/4] mm: declare VMA flags by bit

From: Gregory Price

Date: Fri Oct 31 2025 - 09:58:23 EST


On Wed, Oct 29, 2025 at 05:49:35PM +0000, Lorenzo Stoakes wrote:
>
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index db16ed91c269..c113a3eb5cbd 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -1182,10 +1182,10 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
> [ilog2(VM_PKEY_BIT0)] = "",
> [ilog2(VM_PKEY_BIT1)] = "",
> [ilog2(VM_PKEY_BIT2)] = "",
> -#if VM_PKEY_BIT3
> +#if CONFIG_ARCH_PKEY_BITS > 3
> [ilog2(VM_PKEY_BIT3)] = "",
> #endif
> -#if VM_PKEY_BIT4
> +#if CONFIG_ARCH_PKEY_BITS > 4
> [ilog2(VM_PKEY_BIT4)] = "",
> #endif
> #endif /* CONFIG_ARCH_HAS_PKEYS */


I realize this causes some annoying churn, but is it possible/reasonable
to break the no-op ifdefsphagetti fixes into a separate diff?

it makes it easier to see this change:

> -# define VM_PKEY_BIT0 VM_HIGH_ARCH_0
> +#define VM_PKEY_BIT0 VMA_BIT(VMA_PKEY_BIT0_BIT)

~Gregory