Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/memblock: use PAGE_ALIGN_DOWN to get pgend in free_memmap

Leverage the macro PAGE_ALIGN_DOWN to get pgend.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Link: https://lore.kernel.org/r/20240507075833.6346-7-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>

authored by

Wei Yang and committed by
Mike Rapoport (IBM)
b73f6b98 1eb0a28d

+2 -1
+1 -1
mm/memblock.c
··· 2039 2039 * downwards. 2040 2040 */ 2041 2041 pg = PAGE_ALIGN(__pa(start_pg)); 2042 - pgend = __pa(end_pg) & PAGE_MASK; 2042 + pgend = PAGE_ALIGN_DOWN(__pa(end_pg)); 2043 2043 2044 2044 /* 2045 2045 * If there are free pages between these, free the section of the
+1
tools/include/linux/mm.h
··· 12 12 #define PHYS_ADDR_MAX (~(phys_addr_t)0) 13 13 14 14 #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) 15 + #define PAGE_ALIGN_DOWN(addr) ALIGN_DOWN(addr, PAGE_SIZE) 15 16 16 17 #define __va(x) ((void *)((unsigned long)(x))) 17 18 #define __pa(x) ((unsigned long)(x))