2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-26 07:35:44 +08:00
linux-next/kernel/dma
Robin Murphy ad78dee0b6 dma-debug: Batch dma_debug_entry allocation
DMA debug entries are one of those things which aren't that useful
individually - we will always want some larger quantity of them - and
which we don't really need to manage the exact number of - we only care
about having 'enough'. In that regard, the current behaviour of creating
them one-by-one leads to a lot of unwarranted function call overhead and
memory wasted on alignment padding.

Now that we don't have to worry about freeing anything via
dma_debug_resize_entries(), we can optimise the allocation behaviour by
grabbing whole pages at once, which will save considerably on the
aforementioned overheads, and probably offer a little more cache/TLB
locality benefit for traversing the lists under normal operation. This
should also give even less reason for an architecture-level override of
the preallocation size, so make the definition unconditional - if there
is still any desire to change the compile-time value for some platforms
it would be better off as a Kconfig option anyway.

Since freeing a whole page of entries at once becomes enough of a
challenge that it's not really worth complicating dma_debug_init(), we
may as well tweak the preallocation behaviour such that as long as we
manage to allocate *some* pages, we can leave debugging enabled on a
best-effort basis rather than otherwise wasting them.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Qian Cai <cai@lca.pw>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-12-11 14:32:13 +01:00
..
coherent.c dma-mapping: move all DMA mapping code to kernel/dma 2018-06-14 08:50:37 +02:00
contiguous.c dma-mapping: fix panic caused by passing empty cma command line argument 2018-09-20 09:01:08 +02:00
debug.c dma-debug: Batch dma_debug_entry allocation 2018-12-11 14:32:13 +01:00
direct.c dma-direct: remove the mapping_error dma_map_ops method 2018-12-06 06:56:36 -08:00
Kconfig dma-mapping: move the arm64 noncoherent alloc/free support to common code 2018-12-01 18:07:11 +01:00
Makefile dma-mapping: move the remap helpers to a separate file 2018-12-01 17:58:34 +01:00
mapping.c dma-mapping: move the remap helpers to a separate file 2018-12-01 17:58:34 +01:00
remap.c dma-mapping: fix lack of DMA address assignment in generic remap allocator 2018-12-05 05:49:10 -08:00
swiotlb.c dma-direct: remove the mapping_error dma_map_ops method 2018-12-06 06:56:36 -08:00
virt.c dma-mapping: move all DMA mapping code to kernel/dma 2018-06-14 08:50:37 +02:00