linux-stable/kernel/dma
Petr Tesarik d5090484b0 swiotlb: do not try to allocate a TLB bigger than MAX_ORDER pages
When allocating a new pool at runtime, reduce the number of slabs so
that the allocation order is at most MAX_ORDER.  This avoids a kernel
warning in __alloc_pages().

The warning is relatively benign, because the pool size is subsequently
reduced when allocation fails, but it is silly to start with a request
that is known to fail, especially since this is the default behavior if
the kernel is built with CONFIG_SWIOTLB_DYNAMIC=y and booted without any
swiotlb= parameter.

Reported-by: Ben Greear <greearb@candelatech.com>
Closes: https://lore.kernel.org/netdev/4f173dd2-324a-0240-ff8d-abf5c191be18@candelatech.com/
Fixes: 1aaa736815 ("swiotlb: allocate a new memory pool when existing pools are full")
Signed-off-by: Petr Tesarik <petr.tesarik1@huawei-partners.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2023-10-25 16:26:20 +02:00
..
Kconfig dma-contiguous: fix the Kconfig entry for CONFIG_DMA_NUMA_CMA 2023-08-30 13:52:53 +02:00
Makefile dma-mapping: remove CONFIG_DMA_REMAP 2022-03-03 14:00:57 +03:00
coherent.c dma-mapping: Add dma_release_coherent_memory to DMA API 2022-06-24 09:30:54 -06:00
contiguous.c Revert "dma-contiguous: check for memory region overlap" 2023-09-08 05:58:32 -03:00
debug.c dma-debug: don't call __dma_entry_alloc_check_leak() under free_entries_lock 2023-08-30 11:29:08 +02:00
debug.h dma-debug: teach add_dma_entry() about DMA_ATTR_SKIP_CPU_SYNC 2021-10-18 12:46:45 +02:00
direct.c swiotlb: if swiotlb is full, fall back to a transient memory pool 2023-08-01 18:02:20 +02:00
direct.h dma-mapping: force bouncing if the kmalloc() size is not cache-line-aligned 2023-06-19 16:19:23 -07:00
dummy.c dma-mapping: return error code from dma_dummy_map_sg() 2021-08-09 17:13:06 +02:00
map_benchmark.c dma-mapping: benchmark: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:51 -07:00
mapping.c dma-mapping: move arch_dma_set_mask() declaration to header 2023-07-31 17:54:28 +02:00
ops_helpers.c dma-mapping: handle vmalloc addresses in dma_common_{mmap,get_sgtable} 2021-07-16 11:30:26 +02:00
pool.c dma-pool: remove a __maybe_unused label in atomic_pool_expand 2023-08-31 14:12:37 +02:00
remap.c dma-remap: use kvmalloc_array/kvfree for larger dma memory remap 2023-06-07 15:06:28 +02:00
swiotlb.c swiotlb: do not try to allocate a TLB bigger than MAX_ORDER pages 2023-10-25 16:26:20 +02:00