Revision 2be23c475af8ae4e25f8bab08d815b17593bd547 authored by Russell King on 08 September 2010, 15:27:56 UTC, committed by Russell King on 08 September 2010, 15:27:56 UTC
Dave Hylands reports: | We've observed a problem with dma_alloc_writecombine when the system | is under heavy load (heavy bus traffic). We've managed to reduce the | problem to the following snippet, which is run from a kthread in a | continuous loop: | | void *virtAddr; | dma_addr_t physAddr; | unsigned int numBytes = 256; | | for (;;) { | virtAddr = dma_alloc_writecombine(NULL, | numBytes, &physAddr, GFP_KERNEL); | if (virtAddr == NULL) { | printk(KERN_ERR "Running out of memory\n"); | break; | } | | /* access DMA memory allocated */ | tmp = virtAddr; | *tmp = 0x77; | | /* free DMA memory */ | dma_free_writecombine(NULL, | numBytes, virtAddr, physAddr); | | ...sleep here... | } | | By itself, the code will run forever with no issues. However, as we | increase our bus traffic (typically using DMA) then the *tmp = 0x77 | line will eventually cause a page fault. If we add a small delay (a | few microseconds) before the *tmp = 0x77, then we don't see a page | fault, even under heavy load. A dsb() is required after modifying the PTE entries to ensure that they will always be visible. Add this dsb(). Reported-by: Dave Hylands <dhylands@gmail.com> Tested-by: Dave Hylands <dhylands@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent a387f0f
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 4.6 KB |
Makefile | -rw-r--r-- | 1.3 KB |
apm_power.c | -rw-r--r-- | 10.1 KB |
bq27x00_battery.c | -rw-r--r-- | 10.3 KB |
collie_battery.c | -rw-r--r-- | 9.5 KB |
da9030_battery.c | -rw-r--r-- | 15.9 KB |
ds2760_battery.c | -rw-r--r-- | 18.2 KB |
ds2782_battery.c | -rw-r--r-- | 9.5 KB |
intel_mid_battery.c | -rw-r--r-- | 21.6 KB |
jz4740-battery.c | -rw-r--r-- | 11.0 KB |
max17040_battery.c | -rw-r--r-- | 7.0 KB |
max8925_power.c | -rw-r--r-- | 13.6 KB |
olpc_battery.c | -rw-r--r-- | 12.5 KB |
pcf50633-charger.c | -rw-r--r-- | 12.6 KB |
pda_power.c | -rw-r--r-- | 10.4 KB |
pmu_battery.c | -rw-r--r-- | 5.3 KB |
power_supply.h | -rw-r--r-- | 1.1 KB |
power_supply_core.c | -rw-r--r-- | 5.4 KB |
power_supply_leds.c | -rw-r--r-- | 4.0 KB |
power_supply_sysfs.c | -rw-r--r-- | 7.8 KB |
s3c_adc_battery.c | -rw-r--r-- | 10.7 KB |
test_power.c | -rw-r--r-- | 4.2 KB |
tosa_battery.c | -rw-r--r-- | 11.5 KB |
wm831x_backup.c | -rw-r--r-- | 5.4 KB |
wm831x_power.c | -rw-r--r-- | 16.1 KB |
wm8350_power.c | -rw-r--r-- | 14.9 KB |
wm97xx_battery.c | -rw-r--r-- | 7.4 KB |
z2_battery.c | -rw-r--r-- | 7.6 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...