[BLOCK] Fix bounce limit address check
authorAndi Kleen <ak@suse.de>
Wed, 21 Jun 2006 12:48:09 +0000 (14:48 +0200)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Fri, 23 Jun 2006 15:10:39 +0000 (17:10 +0200)
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 <axboe@suse.de>
block/ll_rw_blk.c

index 2270bb451385a39e09c16fbde74e4d6c472f0d8f..0603ab2f3692283f7fbeee2ef88a7ebb0bba9864 100644 (file)
@@ -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