diff options
author | Andi Kleen <ak@suse.de> | 2006-08-07 21:26:18 +0200 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2006-08-07 21:26:18 +0200 |
commit | 3d6cf29b3f117605c66583b9145f53d39c695a6e (patch) | |
tree | 7a6e7ab73e7269a89bc4c0fdff27e92b67ab2161 /block | |
parent | ad29cb6531ebcc567327ab3030516f2f400a1c4e (diff) |
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: Andi Kleen <ak@suse.de>
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'block')
-rw-r--r-- | block/ll_rw_blk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index cd995c3fd5d9..1ce88cf8ff91 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -637,7 +637,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 |