From 3cd124cb0844d4946e09a23debfd2e8f41237ddf Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Thu, 29 Jun 2006 18:59:19 -0700 Subject: [PATCH] block bounce buffer fix, fwd from Andi --- ...block-fix-bounce-limit-address-check.patch | 33 +++++++++++++++++++ queue-2.6.17/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 queue-2.6.17/block-fix-bounce-limit-address-check.patch diff --git a/queue-2.6.17/block-fix-bounce-limit-address-check.patch b/queue-2.6.17/block-fix-bounce-limit-address-check.patch new file mode 100644 index 00000000000..404c216de21 --- /dev/null +++ b/queue-2.6.17/block-fix-bounce-limit-address-check.patch @@ -0,0 +1,33 @@ +From stable-bounces@linux.kernel.org Thu Jun 29 13:14:55 2006 +Date: Thu, 29 Jun 2006 20:54:26 +0200 +From: Andi Kleen +To: stable@kernel.org +Cc: axboe@suse.de +Subject: 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 +Signed-off-by: Jens Axboe +Signed-off-by: Chris Wright +--- + block/ll_rw_blk.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- linux-2.6.17.2.orig/block/ll_rw_blk.c ++++ linux-2.6.17.2/block/ll_rw_blk.c +@@ -638,7 +638,7 @@ void blk_queue_bounce_limit(request_queu + /* 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 diff --git a/queue-2.6.17/series b/queue-2.6.17/series index 2519d3528b1..3ff316bf845 100644 --- a/queue-2.6.17/series +++ b/queue-2.6.17/series @@ -1,3 +1,4 @@ xfs-corruption-fix-for-next-stable-release.patch ib-mthca-restore-missing-pci-registers-after-reset.patch x86_64-fix-modular-pc-speaker.patch +block-fix-bounce-limit-address-check.patch -- 2.47.2