block: fix queue bounce limit calculation
PATCH 1/1 block: fix queue bounce limit calculation
Queue bounce should start after the max page, not on it.
Signed-off-by Chuck Ebbert <[email protected]>
---
Could this explain reported slowdown on x86_64 after limit was changed in 2.6.16.7?
block/ll_rw_blk.c +2 -2
@@ -638,11 +638,11 @@ 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 < (min_t (u64,0xffffffff ,BLK_BOUNCE_HIGH ) >>PAGE_SHIFT )) +if (bounce_pfn <= (min_t (u64,0xffffffff ,BLK_BOUNCE_HIGH ) >>PAGE_SHIFT )) dma =1 ; q->bounce_pfn = max_low_pfn;#else -if (bounce_pfn < blk_max_low_pfn) +if (bounce_pfn <= blk_max_low_pfn) dma =1 ; q->bounce_pfn = bounce_pfn;#endif
Signature · 1 line
Chuck
Quoted 1 line · Chuck Ebbert
Queue bounce should start after the max page, not on it.
The page with memory 0xffffffff...0xffffffff+4096 is already beyond the limit. And 0xffffffff's PFN is 0xffffffff>>PAGE_SHIFT.
I don't see how the patch is correct.
-Andi