linux/arch
David Hildenbrand e16faf2678 cma: factor out minimum alignment requirement
Patch series "mm: enforce pageblock_order < MAX_ORDER".

Having pageblock_order >= MAX_ORDER seems to be able to happen in corner
cases and some parts of the kernel are not prepared for it.

For example, Aneesh has shown [1] that such kernels can be compiled on
ppc64 with 64k base pages by setting FORCE_MAX_ZONEORDER=8, which will
run into a WARN_ON_ONCE(order >= MAX_ORDER) in comapction code right
during boot.

We can get pageblock_order >= MAX_ORDER when the default hugetlb size is
bigger than the maximum allocation granularity of the buddy, in which
case we are no longer talking about huge pages but instead gigantic
pages.

Having pageblock_order >= MAX_ORDER can only make alloc_contig_range()
of such gigantic pages more likely to succeed.

Reliable use of gigantic pages either requires boot time allcoation or
CMA, no need to overcomplicate some places in the kernel to optimize for
corner cases that are broken in other areas of the kernel.

This patch (of 2):

Let's enforce pageblock_order < MAX_ORDER and simplify.

Especially patch #1 can be regarded a cleanup before:
	[PATCH v5 0/6] Use pageblock_order for cma and alloc_contig_range
	alignment. [2]

[1] https://lkml.kernel.org/r/87r189a2ks.fsf@linux.ibm.com
[2] https://lkml.kernel.org/r/20220211164135.1803616-1-zi.yan@sent.com

Link: https://lkml.kernel.org/r/20220214174132.219303-2-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Acked-by: Rob Herring <robh@kernel.org>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: John Garry via iommu <iommu@lists.linux-foundation.org>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-03-22 15:57:05 -07:00
..
alpha bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
arc bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
arm ARM: Spectre-BHB: provide empty stub for non-config 2022-03-11 12:42:49 -08:00
arm64 mm: merge pte_mkhuge() call into arch_make_huge_pte() 2022-03-22 15:57:04 -07:00
csky bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
h8300 bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
hexagon mm: remove mmu_gathers storage from remaining architectures 2022-03-22 15:57:04 -07:00
ia64 ia64: make IA64_MCA_RECOVERY bool instead of tristate 2022-01-30 09:56:58 +02:00
m68k bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
microblaze Kbuild updates for v5.17 2022-01-19 11:15:19 +02:00
mips MIPS: ralink: mt7621: use bitwise NOT instead of logical 2022-03-01 10:08:45 +01:00
nds32 mm: remove mmu_gathers storage from remaining architectures 2022-03-22 15:57:04 -07:00
nios2 Kbuild updates for v5.17 2022-01-19 11:15:19 +02:00
openrisc mm: remove mmu_gathers storage from remaining architectures 2022-03-22 15:57:04 -07:00
parisc parisc/unaligned: Fix ldw() and stw() unalignment handlers 2022-02-23 18:01:06 +01:00
powerpc cma: factor out minimum alignment requirement 2022-03-22 15:57:05 -07:00
riscv RISC-V Fixes for 5.17-rc8 2022-03-11 12:28:21 -08:00
s390 s390 updates for 5.17-rc7 2022-03-05 11:25:26 -08:00
sh bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
sparc mm: merge pte_mkhuge() call into arch_make_huge_pte() 2022-03-22 15:57:04 -07:00
um virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00
x86 kvm/emulate: Fix SETcc emulation function offsets with SLS 2022-03-20 14:55:46 +01:00
xtensa bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
.gitignore
Kconfig Merge branch 'akpm' (patches from Andrew) 2022-01-20 10:41:01 +02:00