WSL2-Linux-Kernel/drivers/of
David Hildenbrand 51163bfef6 cma: factor out minimum alignment requirement
[ Upstream commit e16faf2678 ]

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>
Stable-dep-of: b174f139bdc8 ("mm/cma: drop incorrect alignment check in cma_init_reserved_mem")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 09:14:13 +02:00
..
unittest-data of: Fix double free in of_parse_phandle_with_args_map 2024-01-25 14:52:46 -08:00
Kconfig of: net: move of_net under net/ 2022-03-08 19:12:41 +01:00
Makefile of: net: move of_net under net/ 2022-03-08 19:12:41 +01:00
address.c of/address: Return an error when no valid dma-ranges are found 2023-02-14 19:17:57 +01:00
base.c of: Fix double free in of_parse_phandle_with_args_map 2024-01-25 14:52:46 -08:00
device.c of: Fix modalias string generation 2023-05-11 23:00:32 +09:00
dynamic.c of: dynamic: Synchronize of_changeset_destroy() with the devlink removals 2024-04-10 16:19:42 +02:00
fdt.c of: fdt: fix off-by-one error in unflatten_dt_nodes() 2022-09-23 14:15:46 +02:00
fdt_address.c
irq.c of: Add missing 'Return' section in kerneldoc comments 2021-03-27 12:59:03 -06:00
kexec.c of: kexec: Mark ima_{free,stable}_kexec_buffer() as __init 2023-09-19 12:22:30 +02:00
kobj.c of: Don't allow __of_attached_node_sysfs() without CONFIG_SYSFS 2021-08-23 13:52:09 -05:00
of_numa.c
of_private.h of: Move of_dma_set_restricted_buffer() into device.c 2021-08-23 06:32:02 -04:00
of_reserved_mem.c cma: factor out minimum alignment requirement 2024-07-05 09:14:13 +02:00
overlay.c of: overlay: Reorder struct fragment fields kerneldoc 2023-10-19 23:05:32 +02:00
pdt.c
platform.c iommu: Drop unnecessary of_iommu.h includes 2021-06-08 14:15:46 +02:00
property.c of: property: fix typo in io-channels 2024-02-23 08:55:10 +01:00
resolver.c
unittest.c of: unittest: Fix compile in the non-dynamic case 2024-02-23 08:55:01 +01:00