- 论坛徽章:
- 16
|
本帖最后由 embeddedlwp 于 2012-05-27 10:18 编辑
460void blk_queue_bounce(request_queue_t *q, struct bio **bio_orig)
461{
462 mempool_t *pool;
463
464 /*
465 * for non-isa bounce case, just check if the bounce pfn is equal
466 * to or bigger than the highest pfn in the system -- in that case,
467 * don't waste time iterating over bio segments
468 */
469 if (!(q->bounce_gfp & GFP_DMA)) {
470 if (q->bounce_pfn >= blk_max_pfn)
471 return;
472 pool = page_pool;
473 } else {
474 BUG_ON(!isa_page_pool);
475 pool = isa_page_pool;
476 }
477
478 /*
479 * slow path
480 */
481 __blk_queue_bounce(q, bio_orig, pool);
482}
这里if (!(q->bounce_gfp & GFP_DMA)),什么时候需要回弹且bounce_gfp的GFP_DMA没有置位?
ULK3上说“ISA总线使用老式的DMA只能处理24的物理地址。因此,回弹缓冲区的上限设为16MB,也就是说,
页框号为4096,。然而,当处理老式设备时,块设备驱动程序通常不依赖回弹缓冲区,相反,它们更倾向于直接
在ZONE_DMA内存区中分配DMA缓冲区”
对这句话我的理解是,驱动想从ZONE_DMA分配,但是如果分配不成功那么会fall back到ZONE_NORMAL,
如果还是分配不成功fall back到ZONE_HIGH,此时再要访问memory只能通过buffer bouncing。不知对不对? |
|