23baf831a3
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. [kirill@shutemov.name: fix min() warning] Link: https://lkml.kernel.org/r/20230315153800.32wib3n5rickolvh@box [akpm@linux-foundation.org: fix another min_t warning] [kirill@shutemov.name: fixups per Zi Yan] Link: https://lkml.kernel.org/r/20230316232144.b7ic4cif4kjiabws@box.shutemov.name [akpm@linux-foundation.org: fix underlining in docs] Link: https://lore.kernel.org/oe-kbuild-all/202303191025.VRCTk6mP-lkp@intel.com/ Link: https://lkml.kernel.org/r/20230315113133.11326-11-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc] Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
30 lines
676 B
C
30 lines
676 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2012 ARM Ltd.
|
|
*/
|
|
#ifndef __ASM_SPARSEMEM_H
|
|
#define __ASM_SPARSEMEM_H
|
|
|
|
#define MAX_PHYSMEM_BITS CONFIG_ARM64_PA_BITS
|
|
|
|
/*
|
|
* Section size must be at least 512MB for 64K base
|
|
* page size config. Otherwise it will be less than
|
|
* MAX_ORDER and the build process will fail.
|
|
*/
|
|
#ifdef CONFIG_ARM64_64K_PAGES
|
|
#define SECTION_SIZE_BITS 29
|
|
|
|
#else
|
|
|
|
/*
|
|
* Section size must be at least 128MB for 4K base
|
|
* page size config. Otherwise PMD based huge page
|
|
* entries could not be created for vmemmap mappings.
|
|
* 16K follows 4K for simplicity.
|
|
*/
|
|
#define SECTION_SIZE_BITS 27
|
|
#endif /* CONFIG_ARM64_64K_PAGES */
|
|
|
|
#endif
|