mm, treewide: redefine MAX_ORDER sanely
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 15 Mar 2023 11:31:33 +0000 (14:31 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 6 Apr 2023 02:42:46 +0000 (19:42 -0700)
commit23baf831a32c04f9a968812511540b1b3e648bf5
treefcaca52cefbef2707710ce057f58fb1c955a0559
parent61883d3c32418f16e35e030ca0cfd5d2de95a649
mm, treewide: redefine MAX_ORDER sanely

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>
84 files changed:
Documentation/admin-guide/kdump/vmcoreinfo.rst
Documentation/admin-guide/kernel-parameters.txt
arch/arc/Kconfig
arch/arm/Kconfig
arch/arm/configs/imx_v6_v7_defconfig
arch/arm/configs/milbeaut_m10v_defconfig
arch/arm/configs/oxnas_v6_defconfig
arch/arm/configs/pxa_defconfig
arch/arm/configs/sama7_defconfig
arch/arm/configs/sp7021_defconfig
arch/arm64/Kconfig
arch/arm64/include/asm/sparsemem.h
arch/arm64/kvm/hyp/include/nvhe/gfp.h
arch/arm64/kvm/hyp/nvhe/page_alloc.c
arch/csky/Kconfig
arch/ia64/Kconfig
arch/ia64/include/asm/sparsemem.h
arch/ia64/mm/hugetlbpage.c
arch/loongarch/Kconfig
arch/m68k/Kconfig.cpu
arch/mips/Kconfig
arch/nios2/Kconfig
arch/powerpc/Kconfig
arch/powerpc/configs/85xx/ge_imp3a_defconfig
arch/powerpc/configs/fsl-emb-nonhw.config
arch/powerpc/mm/book3s64/iommu_api.c
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/platforms/powernv/pci-ioda.c
arch/sh/configs/ecovec24_defconfig
arch/sh/mm/Kconfig
arch/sparc/Kconfig
arch/sparc/kernel/pci_sun4v.c
arch/sparc/kernel/traps_64.c
arch/sparc/mm/tsb.c
arch/um/kernel/um_arch.c
arch/xtensa/Kconfig
drivers/base/regmap/regmap-debugfs.c
drivers/block/floppy.c
drivers/crypto/ccp/sev-dev.c
drivers/crypto/hisilicon/sgl.c
drivers/gpu/drm/i915/gem/i915_gem_internal.c
drivers/gpu/drm/i915/gem/selftests/huge_pages.c
drivers/gpu/drm/ttm/ttm_pool.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
drivers/iommu/dma-iommu.c
drivers/irqchip/irq-gic-v3-its.c
drivers/md/dm-bufio.c
drivers/misc/genwqe/card_dev.c
drivers/misc/genwqe/card_utils.c
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/ethernet/ibm/ibmvnic.h
drivers/video/fbdev/hyperv_fb.c
drivers/video/fbdev/vermilion/vermilion.c
drivers/virtio/virtio_balloon.c
drivers/virtio/virtio_mem.c
fs/ramfs/file-nommu.c
include/drm/ttm/ttm_pool.h
include/linux/hugetlb.h
include/linux/mmzone.h
include/linux/pageblock-flags.h
include/linux/slab.h
kernel/crash_core.c
kernel/dma/pool.c
kernel/events/ring_buffer.c
mm/Kconfig
mm/compaction.c
mm/debug_vm_pgtable.c
mm/huge_memory.c
mm/hugetlb.c
mm/kmsan/init.c
mm/memblock.c
mm/memory_hotplug.c
mm/page_alloc.c
mm/page_isolation.c
mm/page_owner.c
mm/page_reporting.c
mm/shuffle.h
mm/slab.c
mm/slub.c
mm/vmscan.c
mm/vmstat.c
net/smc/smc_ib.c
security/integrity/ima/ima_crypto.c
tools/testing/memblock/linux/mmzone.h