linux-yocto/arch/mips/mm
Kevin Brodsky a9b3c355c2 asm-generic: pgalloc: provide generic __pgd_{alloc,free}
We already have a generic implementation of alloc/free up to P4D level, as
well as pgd_free().  Let's finish the work and add a generic PGD-level
alloc helper as well.

Unlike at lower levels, almost all architectures need some specific magic
at PGD level (typically initialising PGD entries), so introducing a
generic pgd_alloc() isn't worth it.  Instead we introduce two new helpers,
__pgd_alloc() and __pgd_free(), and make use of them in the arch-specific
pgd_alloc() and pgd_free() wherever possible.  To accommodate as many arch
as possible, __pgd_alloc() takes a page allocation order.

Because pagetable_alloc() allocates zeroed pages, explicit zeroing in
pgd_alloc() becomes redundant and we can get rid of it.  Some trivial
implementations of pgd_free() also become unnecessary once __pgd_alloc()
is used; remove them.

Another small improvement is consistent accounting of PGD pages by using
GFP_PGTABLE_{USER,KERNEL} as appropriate.

Not all PGD allocations can be handled by the generic helpers.  In
particular, multiple architectures allocate PGDs from a kmem_cache, and
those PGDs may not be page-sized.

Link: https://lkml.kernel.org/r/20250103184415.2744423-6-kevin.brodsky@arm.com
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-25 20:22:24 -08:00
..
c-octeon.c MIPS: c-octeon: Provide alternative SMP cache flush function 2023-04-05 09:45:09 +02:00
c-r3k.c MIPS: mm: Remove local_cache_flush_page 2023-04-05 10:08:53 +02:00
c-r4k.c Just cleanups and fixes 2024-01-17 11:20:50 -08:00
cache.c mm: remove page_mapping() 2024-07-03 19:29:59 -07:00
cerr-sb1.c
cex-gen.S MIPS: Fix typos 2024-01-08 10:39:12 +01:00
cex-oct.S
cex-sb1.S
context.c
dma-noncoherent.c dma-mapping: Simplify arch_setup_dma_ops() 2024-04-26 12:07:28 +02:00
extable.c
fault.c mips: module: rename MODULE_START to MODULES_VADDR 2024-05-14 00:31:43 -07:00
highmem.c
hugetlbpage.c mm/treewide: remove pXd_huge() 2024-04-25 20:55:47 -07:00
init.c arch: make execmem setup available regardless of CONFIG_MODULES 2024-05-14 00:31:44 -07:00
ioremap.c mips: mm: add slab availability checking in ioremap_prot 2023-12-21 15:32:46 +01:00
ioremap64.c
maccess.c
Makefile
mmap.c mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
page-funcs.S mips: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-15 10:22:23 +02:00
page.c MIPS: page: Use GPR number macros 2024-02-20 12:41:52 +01:00
pgtable-32.c mips: implement the new page table range API 2023-08-24 16:20:22 -07:00
pgtable-64.c mips: hide conditionally unused functions 2023-12-10 17:21:42 -08:00
pgtable.c asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
physaddr.c MIPS: Fixed __debug_virt_addr_valid() 2022-07-15 14:22:51 +02:00
sc-debugfs.c
sc-ip22.c
sc-mips.c
sc-r5k.c
sc-rm7k.c
tlb-funcs.S mips: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-15 10:22:23 +02:00
tlb-r3k.c Just cleanups and fixes 2024-01-17 11:20:50 -08:00
tlb-r4k.c mm/treewide: replace pXd_huge() with pXd_leaf() 2024-04-25 20:55:46 -07:00
tlbex-fault.S
tlbex.c MIPS: tlbex: Use GPR number macros 2024-02-20 12:41:52 +01:00
uasm-micromips.c
uasm-mips.c
uasm.c