Skip to content

mm: enforce pageblock_order < MAX_ORDER

David Hildenbrand linux-devicetree linux-iommu linux-mm linuxppc-dev lkml virtualization 1 version Applied

Status from this message: [merged] mm-enforce-pageblock_order-max_order.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2cma: factor out minimum alignment requirementarch/powerpc/include/asm/fadump-internal.h arch/powerpc/kernel/fadump.c drivers/of/of_reserved_mem.c +3 more+19 -302 repliesApplied
2/2mm: enforce pageblock_order < MAX_ORDERdrivers/virtio/virtio_mem.c include/linux/cma.h include/linux/pageblock-flags.h +2 more+20 -341 replyApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchRob Herring
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 0/2] 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.

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/[email protected]
[2] https://lkml.kernel.org/r/[email protected]

Cc Andrew Morton <[email protected]>
Cc Aneesh Kumar K V <[email protected]>
Cc Zi Yan <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Rob Herring <[email protected]>
Cc Frank Rowand <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Vlastimil Babka <[email protected]>

David Hildenbrand (2):
cma: factor out minimum alignment requirement
mm: enforce pageblock_order < MAX_ORDER

 arch/powerpc/include/asm/fadump-internal.h |  5 ----
 arch/powerpc/kernel/fadump.c               |  2 +-
 drivers/of/of_reserved_mem.c               |  9 ++----
 drivers/virtio/virtio_mem.c                |  9 ++----
 include/linux/cma.h                        |  8 ++++++
 include/linux/pageblock-flags.h            |  7 +++--
 kernel/dma/contiguous.c                    |  4 +--
 mm/Kconfig                                 |  3 ++
 mm/cma.c                                   | 20 ++++----------
 mm/page_alloc.c                            | 32 ++++++----------------
 10 files changed, 37 insertions(+), 62 deletions(-)

base-commit: 754e0b0e35608ed5206d6a67a791563c631cec07

Signature · 1 line
2.34.1