Commit 9f249168 authored by Andi Kleen's avatar Andi Kleen Committed by Greg Kroah-Hartman

BLOCK: Fix bounce limit address check

This fixes some OOMs on 64bit systems with <4GB of RAM when accessing
the cdrom. 

Do a safer check for when to enable DMA. Currently we enable ISA DMA
for cases that do not need it, resulting in OOM conditions when ZONE_DMA
runs out of space.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 395e8c5b
......@@ -638,7 +638,7 @@ void blk_queue_bounce_limit(request_queue_t *q, u64 dma_addr)
/* Assume anything <= 4GB can be handled by IOMMU.
Actually some IOMMUs can handle everything, but I don't
know of a way to test this here. */
if (bounce_pfn < (0xffffffff>>PAGE_SHIFT))
if (bounce_pfn < (min_t(u64,0xffffffff,BLK_BOUNCE_HIGH) >> PAGE_SHIFT))
dma = 1;
q->bounce_pfn = max_low_pfn;
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment