linux/drivers/dma
Brice Goglin c4d27c4d02 dmaengine: make dma_channel_rebalance() NUMA aware
dma_channel_rebalance() currently distributes channels by processor ID.
These IDs often change with the BIOS, and the order isn't related to
the DMA channel list (related to PCI bus ids).
* On my SuperMicro dual E5 machine, first socket has processor IDs [0-7]
  (and [16-23] for hyperthreads), second socket has [8-15]+[24-31]
  => channels are properly allocated to local CPUs.
* On Dells R720 with same processors, first socket has even processor IDs,
  second socket has odd numbers
  => half the processors get channels on the remote socket, causing
     cross-NUMA traffic and lower DMA performance.

Change nth_chan() to return the channel with min table_count and in the
NUMA node of the given CPU, if any. If none, the (non-local) channel with
min table_count is returned. nth_chan() is therefore renamed into min_chan()
since we don't iterate until the nth channel anymore. In practice, the
behavior is the same because first channels are taken first and are then
ignored because they got an additional reference.

The new code has a slightly higher complexity since we always scan the
entire list of channels for finding the minimal table_count (instead
of stopping after N chans), and because we check whether the CPU is in the
DMA device locality mask. Overall we still have time complexity =
number of chans x number of processors. This rebalance is rarely used,
so this won't hurt.

On the above SuperMicro machine, channels are still allocated the same.
On the Dells, there are no locality issue anymore (MEMCPY channel X goes
to processor X and to its hyperthread sibling).

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
Signed-off-by: Dan Williams <djbw@fb.com>
2013-08-22 22:57:51 -07:00
..
bestcomm Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-02-23 17:09:55 -08:00
dw dmaengine: dw: select DW_DMAC_BIG_ENDIAN_IO automagically 2013-07-05 11:40:46 +05:30
ioat ioatdma: disable RAID on non-Atom platforms and reenable unaligned copies 2013-08-22 22:57:39 -07:00
ipu dma: ipu: ipu_idmac: Fix section mismatch 2013-04-15 09:51:18 +05:30
ppc4xx Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2013-07-07 11:11:43 -07:00
sh DMA: shdma: add DT support 2013-07-05 11:41:00 +05:30
acpi-dma.c dma: acpi-dma: parse CSRT to extract additional resources 2013-05-14 10:23:57 +05:30
amba-pl08x.c dmaengine: PL08x: Avoid collisions with get_signal() macro 2013-07-05 11:40:47 +05:30
at_hdmac_regs.h DMA: AT91: Get residual bytes in dma buffer 2013-07-05 11:40:31 +05:30
at_hdmac.c dmaengine: at_hdmac: prepare clk before calling enable 2013-07-05 11:40:57 +05:30
coh901318_lli.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-02-26 09:24:48 -08:00
coh901318.c dma: coh901318: add devicetree support 2013-06-17 13:54:27 +02:00
coh901318.h
dma-jz4740.c MIPS: jz4740: Remove custom DMA API 2013-07-05 11:40:52 +05:30
dmaengine.c dmaengine: make dma_channel_rebalance() NUMA aware 2013-08-22 22:57:51 -07:00
dmaengine.h
dmatest.c dmatest: print message on debug level in case of no error 2013-08-22 22:57:35 -07:00
edma.c ARM: davinci: move private EDMA API to arm/common 2013-06-18 10:52:03 +05:30
ep93xx_dma.c
fsldma.c dma: use platform_{get,set}_drvdata() 2013-07-05 11:40:32 +05:30
fsldma.h
imx-dma.c DMA: imx-dma: imxdma->dev used uninitialized 2013-07-05 11:40:27 +05:30
imx-sdma.c dma: imx-sdma: move to generic device tree bindings 2013-07-05 11:40:40 +05:30
intel_mid_dma_regs.h
intel_mid_dma.c PM / Runtime: Rework the "runtime idle" helper routine 2013-06-03 21:49:52 +02:00
iop-adma.c drivers/dma/iop-adma.c: fix new warnings 2013-07-09 10:33:19 -07:00
iovlock.c
Kconfig Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2013-07-07 11:11:43 -07:00
Makefile dma: Add a jz4740 dmaengine driver 2013-07-05 11:40:50 +05:30
mmp_pdma.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-02-26 09:24:48 -08:00
mmp_tdma.c dma: mmp_tdma: disable irq when disabling dma channel 2013-07-05 11:40:48 +05:30
mpc512x_dma.c
mv_xor.c mv_xor: support big endian systems using descriptor swap feature 2013-08-22 22:57:37 -07:00
mv_xor.h mv_xor: support big endian systems using descriptor swap feature 2013-08-22 22:57:37 -07:00
mxs-dma.c dma: mxs-dma: Staticize mxs_dma_xlate 2013-07-05 11:40:33 +05:30
of-dma.c dma: of: Remove check on always true condition 2013-06-12 07:49:19 +05:30
omap-dma.c dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver 2013-04-15 09:51:19 +05:30
pch_dma.c pch_dma: fix error return code in pch_dma_probe() 2013-07-22 14:54:23 +05:30
pl330.c dma: pl330: Fix cyclic transfers 2013-07-28 19:08:33 +05:30
sa11x0-dma.c
sirf-dma.c dmaengine: sirf: set dma residue based on the current dma transfer position 2013-07-05 11:40:39 +05:30
ste_dma40_ll.c dmaengine: ste_dma40_ll: Replace meaningless register set with comment 2013-06-04 11:12:10 +02:00
ste_dma40_ll.h dmaengine: ste_dma40: Remove unnecessary call to d40_phy_cfg() 2013-05-23 21:13:19 +02:00
ste_dma40.c DMA40 fixes for earlier submitted driver patches: 2013-06-25 11:20:15 -07:00
tegra20-apb-dma.c dma: tegra: avoid channel lock up after free 2013-07-05 11:40:38 +05:30
timb_dma.c dma: timb_dma: remove unnecessary platform_set_drvdata() 2013-07-05 11:40:35 +05:30
TODO
txx9dmac.c dma: Remove erroneous __exit and __exit_p() references 2013-04-15 09:51:16 +05:30
txx9dmac.h
virt-dma.c
virt-dma.h