linux/arch/csky/include/asm
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
..
Kbuild asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
addrspace.h
asid.h
atomic.h
barrier.h
bitops.h
bug.h
cache.h
cacheflush.h
cachetype.h Introduce cpu_dcache_is_aliasing() across all architectures 2024-02-22 15:27:19 -08:00
checksum.h
clocksource.h
cmpxchg.h csky: Emulate one-byte cmpxchg 2024-05-11 07:07:07 -07:00
elf.h
fixmap.h
ftrace.h function_graph: Everyone uses HAVE_FUNCTION_GRAPH_RET_ADDR_PTR, remove it 2024-06-11 11:18:24 -04:00
futex.h
highmem.h
io.h csky: Use new fallback IO memcpy/memset 2024-10-28 21:44:29 +00:00
irq_work.h
irqflags.h
jump_label.h
kprobes.h
memory.h
mmu.h
mmu_context.h
page.h asm-generic updates for 6.13 2024-11-20 15:13:02 -08:00
pci.h
perf_event.h
pgalloc.h asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
pgtable.h
probes.h
processor.h
ptrace.h
reg_ops.h
seccomp.h
sections.h
shmparam.h
smp.h
spinlock.h
spinlock_types.h
stackprotector.h
string.h
switch_to.h
syscall.h
syscalls.h
tcm.h
thread_info.h
tlb.h
tlbflush.h
traps.h
uaccess.h
unistd.h csky: convert to generic syscall table 2024-07-10 14:23:38 +02:00
uprobes.h
vdso.h
vmalloc.h