mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 18:12:48 +00:00
MAX_ORDER currently defined as number of orders page allocator supports: user can ask buddy allocator for page order between 0 and MAX_ORDER-1. This definition is counter-intuitive and lead to number of bugs all over the kernel. Change the definition of MAX_ORDER to be inclusive: the range of orders user can ask from buddy allocator is 0..MAX_ORDER now. [[email protected]: fix min() warning] Link: https://lkml.kernel.org/r/20230315153800.32wib3n5rickolvh@box [[email protected]: fix another min_t warning] [[email protected]: fixups per Zi Yan] Link: https://lkml.kernel.org/r/[email protected] [[email protected]: fix underlining in docs] Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kirill A. Shutemov <[email protected]> Reviewed-by: Michael Ellerman <[email protected]> [powerpc] Cc: "Kirill A. Shutemov" <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
29 lines
778 B
C
29 lines
778 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_IA64_SPARSEMEM_H
|
|
#define _ASM_IA64_SPARSEMEM_H
|
|
|
|
#ifdef CONFIG_SPARSEMEM
|
|
#include <asm/page.h>
|
|
/*
|
|
* SECTION_SIZE_BITS 2^N: how big each section will be
|
|
* MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
|
|
*/
|
|
|
|
#define SECTION_SIZE_BITS (30)
|
|
#define MAX_PHYSMEM_BITS (50)
|
|
#ifdef CONFIG_ARCH_FORCE_MAX_ORDER
|
|
#if (CONFIG_ARCH_FORCE_MAX_ORDER + PAGE_SHIFT > SECTION_SIZE_BITS)
|
|
#undef SECTION_SIZE_BITS
|
|
#define SECTION_SIZE_BITS (CONFIG_ARCH_FORCE_MAX_ORDER + PAGE_SHIFT)
|
|
#endif
|
|
#endif
|
|
|
|
#endif /* CONFIG_SPARSEMEM */
|
|
|
|
#ifdef CONFIG_MEMORY_HOTPLUG
|
|
int memory_add_physaddr_to_nid(u64 addr);
|
|
#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
|
|
#endif
|
|
|
|
#endif /* _ASM_IA64_SPARSEMEM_H */
|