LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: axboe@kernel.dk, linux-kernel@vger.kernel.org
Subject: [PATCH] [5/7] Convert the blk allocator functions over to the mask allocator
Date: Fri, 7 Mar 2008 10:13:26 +0100 (CET) [thread overview]
Message-ID: <20080307091326.0AC3A1B419C@basil.firstfloor.org> (raw)
In-Reply-To: <200803071013.837692778@firstfloor.org>
This is a separate patch because the block allocator functions are
only getting introduced by my earlier SCSI DMA cleanup patch kit.
This means this patch alone relies on them. Without that patchkit
applied earlier it can be safely dropped.
Right now blk_kmalloc rounds up to pages. There are only a few callers
so adding a sub allocator for that doesn't seem worthwhile.
Signed-off-by: Andi Kleen <ak@suse.de>
---
block/blk-settings.c | 7 +++++--
include/linux/blkdev.h | 4 ++--
2 files changed, 7 insertions(+), 4 deletions(-)
Index: linux/include/linux/blkdev.h
===================================================================
--- linux.orig/include/linux/blkdev.h
+++ linux/include/linux/blkdev.h
@@ -560,12 +560,12 @@ extern struct page *blk_alloc_pages(stru
extern void *blk_kmalloc(struct request_queue *q, unsigned size, gfp_t gfp);
static inline void blk_free_pages(struct page *p, int size)
{
- __free_pages(p, get_order(size));
+ __free_pages_mask(p, size);
}
static inline void blk_kfree(void *p, int size)
{
- kfree(p);
+ free_pages_mask(p, size);
}
struct req_iterator {
Index: linux/block/blk-settings.c
===================================================================
--- linux.orig/block/blk-settings.c
+++ linux/block/blk-settings.c
@@ -159,13 +159,16 @@ EXPORT_SYMBOL(blk_queue_bounce_limit);
struct page *blk_alloc_pages(struct request_queue *q,
gfp_t gfp, int size)
{
- return alloc_pages((q->bounce_gfp & ~GFP_NOIO) | gfp, get_order(size));
+ return alloc_pages_mask(gfp, size, blk_q_mask(q));
}
EXPORT_SYMBOL(blk_alloc_pages);
void *blk_kmalloc(struct request_queue *q, unsigned size, gfp_t gfp)
{
- return kmalloc(size, gfp | (q->bounce_gfp & ~GFP_NOIO));
+ /* Right now gets pages. That is ok for the few callers. Later
+ * might need to use a sub allocator.
+ */
+ return get_pages_mask(gfp, size, blk_q_mask(q));
}
EXPORT_SYMBOL(blk_kmalloc);
next prev parent reply other threads:[~2008-03-07 9:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-07 9:13 [PATCH] [0/7] Block layer rework for " Andi Kleen
2008-03-07 9:13 ` [PATCH] [1/7] Convert a few direct bounce_gfp users over to the blk_* wrappers Andi Kleen
2008-03-07 9:13 ` [PATCH] [2/7] Convert open coded reference in libata to q->bounce_gfp to blk_kmalloc Andi Kleen
2008-03-07 21:06 ` Jeff Garzik
2008-03-07 9:13 ` [PATCH] [3/7] Add mempool support for page allocation through the mask allocator Andi Kleen
2008-03-07 9:13 ` [PATCH] [4/7] Add blk_q_mask Andi Kleen
2008-03-07 9:13 ` Andi Kleen [this message]
2008-03-07 9:13 ` [PATCH] [6/7] Remove bounce_gfp Andi Kleen
2008-03-07 9:13 ` [PATCH] [7/7] Allow swiotlb to move block data bouncing to the block layer Andi Kleen
2008-03-08 12:08 ` Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080307091326.0AC3A1B419C@basil.firstfloor.org \
--to=andi@firstfloor.org \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: [PATCH] [5/7] Convert the blk allocator functions over to the mask allocator' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).