Skip to content

Commit

Permalink
[BLOCK] Fix bounce limit address check
Browse files Browse the repository at this point in the history
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: Jens Axboe <[email protected]>
  • Loading branch information
Andi Kleen authored and Jens Axboe committed Jun 23, 2006
1 parent dd67d05 commit 8269730
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8269730

Please sign in to comment.