]> Gentwo Git Trees - linux/.git/commit
mm: introduce memdesc_flags_t
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 5 Aug 2025 17:22:51 +0000 (18:22 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 13 Sep 2025 23:55:07 +0000 (16:55 -0700)
commit53fbef56e07df822ea3029109ffca25328c2e5ac
tree8f68e237755cc342682e0515e5b691536859312e
parent4e915656a38afe8aeebb283493f49c22d675a9fc
mm: introduce memdesc_flags_t

Patch series "Add and use memdesc_flags_t".

At some point struct page will be separated from struct slab and struct
folio.  This is a step towards that by introducing a type for the 'flags'
word of all three structures.  This gives us a certain amount of type
safety by establishing that some of these unsigned longs are different
from other unsigned longs in that they contain things like node ID,
section number and zone number in the upper bits.  That lets us have
functions that can be easily called by anyone who has a slab, folio or
page (but not easily by anyone else) to get the node or zone.

There's going to be some unusual merge problems with this as some odd bits
of the kernel decide they want to print out the flags value or something
similar by writing page->flags and now they'll need to write page->flags.f
instead.  That's most of the churn here.  Maybe we should be removing
these things from the debug output?

This patch (of 11):

Wrap the unsigned long flags in a typedef.  In upcoming patches, this will
provide a strong hint that you can't just pass a random unsigned long to
functions which take this as an argument.

[willy@infradead.org: s/flags/flags.f/ in several architectures]
Link: https://lkml.kernel.org/r/aKMgPRLD-WnkPxYm@casper.infradead.org
[nicola.vetrini@gmail.com: mips: fix compilation error]
Link: https://lore.kernel.org/lkml/CA+G9fYvkpmqGr6wjBNHY=dRp71PLCoi2341JxOudi60yqaeUdg@mail.gmail.com/
Link: https://lkml.kernel.org/r/20250825214245.1838158-1-nicola.vetrini@gmail.com
Link: https://lkml.kernel.org/r/20250805172307.1302730-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20250805172307.1302730-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
58 files changed:
arch/arc/mm/cache.c
arch/arc/mm/tlb.c
arch/arm/include/asm/hugetlb.h
arch/arm/mm/copypage-v4mc.c
arch/arm/mm/copypage-v6.c
arch/arm/mm/copypage-xscale.c
arch/arm/mm/dma-mapping.c
arch/arm/mm/fault-armv.c
arch/arm/mm/flush.c
arch/arm64/include/asm/hugetlb.h
arch/arm64/include/asm/mte.h
arch/arm64/mm/flush.c
arch/csky/abiv1/cacheflush.c
arch/mips/include/asm/cacheflush.h
arch/nios2/mm/cacheflush.c
arch/openrisc/include/asm/cacheflush.h
arch/openrisc/mm/cache.c
arch/parisc/kernel/cache.c
arch/powerpc/include/asm/cacheflush.h
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/mm/book3s64/hash_utils.c
arch/powerpc/mm/pgtable.c
arch/riscv/include/asm/cacheflush.h
arch/riscv/include/asm/hugetlb.h
arch/riscv/mm/cacheflush.c
arch/s390/include/asm/hugetlb.h
arch/s390/kernel/uv.c
arch/s390/mm/gmap.c
arch/s390/mm/hugetlbpage.c
arch/sh/include/asm/hugetlb.h
arch/sh/mm/cache-sh4.c
arch/sh/mm/cache-sh7705.c
arch/sh/mm/cache.c
arch/sh/mm/kmap.c
arch/sparc/mm/init_64.c
arch/x86/mm/pat/memtype.c
arch/xtensa/mm/cache.c
fs/fuse/dev.c
fs/gfs2/glops.c
fs/jffs2/file.c
fs/nilfs2/page.c
fs/proc/page.c
fs/ubifs/file.c
include/linux/mm.h
include/linux/mm_inline.h
include/linux/mm_types.h
include/linux/mmzone.h
include/linux/page-flags.h
include/linux/pgalloc_tag.h
include/trace/events/page_ref.h
mm/filemap.c
mm/huge_memory.c
mm/memory-failure.c
mm/mmzone.c
mm/page_alloc.c
mm/swap.c
mm/vmscan.c
mm/workingset.c