[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080307091327.0EA141B419C@basil.firstfloor.org>
Date: Fri, 7 Mar 2008 10:13:27 +0100 (CET)
From: Andi Kleen <andi@...stfloor.org>
To: axboe@...nel.dk, linux-kernel@...r.kernel.org
Subject: [PATCH] [6/7] Remove bounce_gfp
Convert mm/bounce.c to use a mask allocator mempool for ISA DMA
memory and then remove bounce_gfp. All bouncing is controlled
by bounce_pfn now.
Signed-off-by: Andi Kleen <ak@...e.de>
---
block/blk-settings.c | 2 --
include/linux/blkdev.h | 1 -
mm/bounce.c | 16 ++++------------
3 files changed, 4 insertions(+), 15 deletions(-)
Index: linux/include/linux/blkdev.h
===================================================================
--- linux.orig/include/linux/blkdev.h
+++ linux/include/linux/blkdev.h
@@ -324,7 +324,6 @@ struct request_queue
* queue needs bounce pages for pages above this limit
*/
unsigned long bounce_pfn;
- gfp_t bounce_gfp;
/*
* various queue flags, see QUEUE_* below
Index: linux/block/blk-settings.c
===================================================================
--- linux.orig/block/blk-settings.c
+++ linux/block/blk-settings.c
@@ -135,7 +135,6 @@ void blk_queue_bounce_limit(struct reque
unsigned long b_pfn = dma_addr >> PAGE_SHIFT;
int dma = 0;
- q->bounce_gfp = GFP_NOIO;
#if BITS_PER_LONG == 64
/* Assume anything <= 4GB can be handled by IOMMU.
Actually some IOMMUs can handle everything, but I don't
@@ -150,7 +149,6 @@ void blk_queue_bounce_limit(struct reque
#endif
if (dma) {
init_emergency_isa_pool();
- q->bounce_gfp = GFP_NOIO | GFP_DMA;
q->bounce_pfn = b_pfn;
}
}
Index: linux/mm/bounce.c
===================================================================
--- linux.orig/mm/bounce.c
+++ linux/mm/bounce.c
@@ -63,14 +63,6 @@ static void bounce_copy_vec(struct bio_v
#endif /* CONFIG_HIGHMEM */
/*
- * allocate pages in the DMA region for the ISA pool
- */
-static void *mempool_alloc_pages_isa(gfp_t gfp_mask, void *data)
-{
- return mempool_alloc_pages(gfp_mask | GFP_DMA, data);
-}
-
-/*
* gets called "every" time someone init's a queue with BLK_BOUNCE_ISA
* as the max address, so check if the pool has already been created.
*/
@@ -79,8 +71,8 @@ int init_emergency_isa_pool(void)
if (isa_page_pool)
return 0;
- isa_page_pool = mempool_create(ISA_POOL_SIZE, mempool_alloc_pages_isa,
- mempool_free_pages, (void *) 0);
+ isa_page_pool = mempool_create_pool_pmask(ISA_POOL_SIZE, PAGE_SIZE,
+ ISA_DMA_THRESHOLD);
BUG_ON(!isa_page_pool);
printk("isa bounce pool size: %d pages\n", ISA_POOL_SIZE);
@@ -200,7 +192,7 @@ static void __blk_queue_bounce(struct re
to = bio->bi_io_vec + i;
- to->bv_page = mempool_alloc(pool, q->bounce_gfp);
+ to->bv_page = mempool_alloc(pool, GFP_NOIO);
to->bv_len = from->bv_len;
to->bv_offset = from->bv_offset;
inc_zone_page_state(to->bv_page, NR_BOUNCE);
@@ -275,7 +267,7 @@ void blk_queue_bounce(struct request_que
* to or bigger than the highest pfn in the system -- in that case,
* don't waste time iterating over bio segments
*/
- if (!(q->bounce_gfp & GFP_DMA)) {
+ if (q->bounce_pfn >= BLK_BOUNCE_ISA) {
if (q->bounce_pfn >= blk_max_pfn)
return;
pool = page_pool;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists