linux-yocto/drivers
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: b174f139bd ("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
..
accessibility speakup: Fix sizeof() vs ARRAY_SIZE() bug 2024-06-16 13:39:11 +02:00
acpi ACPI: resource: Do IRQ override on TongFang GXxHRXx and GMxHGxx 2024-06-16 13:39:55 +02:00
amba
android binder: fix max_thread type inconsistency 2024-05-25 16:20:18 +02:00
ata ata: pata_legacy: make legacy_exit() work again 2024-06-16 13:39:55 +02:00
atm
auxdisplay
base
bcma
block null_blk: Fix the WARNING: modpost: missing MODULE_DESCRIPTION() 2024-06-16 13:39:45 +02:00
bluetooth Bluetooth: qca: fix info leak when fetching fw build id 2024-07-05 09:14:11 +02:00
bus
cdrom
char ppdev: Add an error check in register_device 2024-06-16 13:39:39 +02:00
clk clk: qcom: mmcc-msm8998: fix venus clock issue 2024-06-16 13:39:31 +02:00
clocksource
comedi
connector
counter
cpufreq cppc_cpufreq: Fix possible null pointer dereference 2024-06-16 13:39:21 +02:00
cpuidle
crypto crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak 2024-06-16 13:39:58 +02:00
cxl
dax
dca
devfreq
dio
dma dmaengine: idma64: Add check for dma_set_max_seg_size 2024-06-16 13:39:34 +02:00
dma-buf dma-buf/sw-sync: don't enable IRQ from sync_print_obj() 2024-06-16 13:39:49 +02:00
edac EDAC/igen6: Convert PCIBIOS_* return codes to errnos 2024-06-16 13:40:00 +02:00
eisa
extcon extcon: max8997: select IRQ_DOMAIN instead of depending on it 2024-06-16 13:39:39 +02:00
firewire firewire: nosy: ensure user_length is taken into account when fetching packet contents 2024-05-17 11:51:01 +02:00
firmware firmware: dmi-id: add a release callback function 2024-06-16 13:39:34 +02:00
fpga fpga: region: add owner module and take its refcount 2024-06-16 13:39:38 +02:00
fsi
gnss
gpio gpio: crystalcove: Use -ENOTSUPP consistently 2024-05-17 11:50:55 +02:00
gpu drm/amd/display: Fix incorrect DSC instance for MST 2024-07-05 09:14:10 +02:00
greybus
hid HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors 2024-06-16 13:39:24 +02:00
hsi
hv
hwmon hwmon: (shtc1) Fix property misspelling 2024-06-16 13:39:52 +02:00
hwspinlock
hwtracing intel_th: pci: Add Meteor Lake-S CPU support 2024-06-16 13:39:58 +02:00
i2c i2c: acpi: Unbind mux adapters before delete 2024-07-05 09:14:13 +02:00
i3c i3c: master: svc: fix invalidate IBI type and miss call client IBI handler 2024-06-16 13:40:00 +02:00
idle
iio iio: accel: mxc4005: Reset chip on probe() and resume() 2024-07-05 09:14:09 +02:00
infiniband RDMA/IPoIB: Fix format truncation compilation errors 2024-06-16 13:39:33 +02:00
input Input: cyapa - add missing input core locking to suspend/resume functions 2024-06-16 13:39:43 +02:00
interconnect
iommu iommu: mtk: fix module autoloading 2024-05-17 11:50:55 +02:00
ipack
irqchip irqchip/loongson-pch-msi: Fix off-by-one on allocation error path 2024-06-16 13:39:20 +02:00
isdn
leds
macintosh macintosh/via-macii: Fix "BUG: sleeping function called from invalid context" 2024-06-16 13:39:23 +02:00
mailbox
mcb
md md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING 2024-06-16 13:39:56 +02:00
media media: v4l2-core: hold videodev_lock until dev reg, finishes 2024-06-16 13:39:57 +02:00
memory
memstick
message
mfd
misc misc/pvpanic-pci: register attributes via pci_driver 2024-07-05 09:14:10 +02:00
mmc mmc: davinci: Don't strip remove function when driver is builtin 2024-07-05 09:14:12 +02:00
most
mtd mtd: rawnand: hynix: fixed typo 2024-06-16 13:39:27 +02:00
mux
net vxlan: Fix regression when dropping packets due to invalid src addresses 2024-07-05 09:14:06 +02:00
nfc NFC: trf7970a: disable all regulators on removal 2024-05-02 16:24:45 +02:00
ntb
nubus
nvdimm
nvme nvmet: fix ns enable/disable possible hang 2024-06-16 13:39:49 +02:00
nvmem
of cma: factor out minimum alignment requirement 2024-07-05 09:14:13 +02:00
opp
parisc
parport
pci PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3 2024-06-16 13:39:39 +02:00
pcmcia
perf
phy
pinctrl pinctrl: core: handle radix_tree_insert() errors in pinctrl_register_one_pin() 2024-05-25 16:20:16 +02:00
platform
pnp
power power: supply: mt6360_charger: Fix of_match for usb-otg-vbus regulator 2024-05-17 11:50:46 +02:00
powercap
pps
ps3
ptp ptp: Fix error message on failed pin verification 2024-07-05 09:14:07 +02:00
pwm pwm: sti: Simplify probe function using devm functions 2024-06-16 13:39:23 +02:00
rapidio
ras
regulator regulator: bd71828: Don't overwrite runtime voltages 2024-06-16 13:39:46 +02:00
remoteproc remoteproc: mediatek: Make sure IPI buffer fits in L2TCM 2024-05-25 16:20:18 +02:00
reset
rpmsg
rtc
s390 s390/ap: Fix crash in AP internal function modify_bitmap() 2024-06-16 13:40:00 +02:00
sbus
scsi scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW major version > 5 2024-06-16 13:40:01 +02:00
sh
siox
slimbus slimbus: qcom-ngd-ctrl: Add timeout for wait operation 2024-05-17 11:51:04 +02:00
soc soc: qcom: rpmh-rsc: Enhance check for VRM in-flight request 2024-06-16 13:39:55 +02:00
soundwire soundwire: cadence: fix invalid PDI offset 2024-06-16 13:39:34 +02:00
spi spi: stm32: Don't warn about spurious interrupts 2024-06-16 13:39:51 +02:00
spmi
ssb
staging greybus: arche-ctrl: move device table to its right location 2024-06-16 13:39:35 +02:00
target scsi: target: Fix SELinux error when systemd-modules loads the target module 2024-05-17 11:50:54 +02:00
tc
tee
thermal thermal/drivers/qcom/lmh: Check for SCM availability at probe 2024-06-16 13:39:55 +02:00
thunderbolt
tty serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler 2024-07-05 09:14:12 +02:00
uio
usb usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete 2024-07-05 09:14:09 +02:00
vdpa
vfio
vhost
video fbdev: savage: Handle err return when savagefb_check_var failed 2024-06-16 13:39:57 +02:00
virt drivers/virt/acrn: fix PFNMAP PTE checks in acrn_vm_ram_map() 2024-06-16 13:39:32 +02:00
virtio virtio: delete vq in vp_find_vqs_msix() when request_irq() fails 2024-06-16 13:39:47 +02:00
visorbus
vlynq
vme
w1
watchdog watchdog: rti_wdt: Set min_hw_heartbeat_ms to accommodate a safety margin 2024-06-16 13:39:59 +02:00
xen
zorro
Kconfig
Makefile