linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: sri@us.ibm.com, andrea@suse.de, pavel@suse.cz, linux-mm@kvack.org
Subject: [patch 5/9] mempool - Update kmalloc mempool users
Date: Wed, 25 Jan 2006 11:40:10 -0800	[thread overview]
Message-ID: <1138218010.2092.5.camel@localhost.localdomain> (raw)
In-Reply-To: <20060125161321.647368000@localhost.localdomain>

plain text document attachment (critical_mempools)
Fixup existing mempool users to use the new mempool API, part 2.

This patch fixes up all the trivial mempool users, all of which are basically
currently just wrappers around kmalloc().  Change these functions to 
call kmalloc_node() with their shiny new 'node_id' argument.

Possible further work:  Many of these functions could be replaced by a single
common mempool_kmalloc() function, storing the size to kmalloc in pool_data.

Signed-off-by: Matthew Dobson <colpatch@us.ibm.com>

 drivers/block/pktcdvd.c      |    8 ++++----
 drivers/md/bitmap.c          |    6 +++---
 drivers/md/dm-io.c           |    4 ++--
 drivers/md/dm-raid1.c        |    4 ++--
 drivers/s390/scsi/zfcp_aux.c |    4 ++--
 drivers/scsi/lpfc/lpfc_mem.c |    4 ++--
 fs/bio.c                     |   12 ++++++------
 7 files changed, 21 insertions(+), 21 deletions(-)

Index: linux-2.6.16-rc1+critical_mempools/drivers/block/pktcdvd.c
===================================================================
--- linux-2.6.16-rc1+critical_mempools.orig/drivers/block/pktcdvd.c
+++ linux-2.6.16-rc1+critical_mempools/drivers/block/pktcdvd.c
@@ -229,9 +229,9 @@ static int pkt_grow_pktlist(struct pktcd
 	return 1;
 }
 
-static void *pkt_rb_alloc(gfp_t gfp_mask, void *data)
+static void *pkt_rb_alloc(gfp_t gfp_mask, int nid, void *data)
 {
-	return kmalloc(sizeof(struct pkt_rb_node), gfp_mask);
+	return kmalloc_node(sizeof(struct pkt_rb_node), gfp_mask, nid);
 }
 
 static void pkt_rb_free(void *ptr, void *data)
@@ -2085,9 +2085,9 @@ static int pkt_close(struct inode *inode
 }
 

-static void *psd_pool_alloc(gfp_t gfp_mask, void *data)
+static void *psd_pool_alloc(gfp_t gfp_mask, int nid, void *data)
 {
-	return kmalloc(sizeof(struct packet_stacked_data), gfp_mask);
+	return kmalloc_node(sizeof(struct packet_stacked_data), gfp_mask, nid);
 }
 
 static void psd_pool_free(void *ptr, void *data)
Index: linux-2.6.16-rc1+critical_mempools/drivers/scsi/lpfc/lpfc_mem.c
===================================================================
--- linux-2.6.16-rc1+critical_mempools.orig/drivers/scsi/lpfc/lpfc_mem.c
+++ linux-2.6.16-rc1+critical_mempools/drivers/scsi/lpfc/lpfc_mem.c
@@ -39,9 +39,9 @@
 #define LPFC_MEM_POOL_SIZE      64      /* max elem in non-DMA safety pool */
 
 static void *
-lpfc_pool_kmalloc(gfp_t gfp_flags, void *data)
+lpfc_pool_kmalloc(gfp_t gfp_flags, int nid, void *data)
 {
-	return kmalloc((unsigned long)data, gfp_flags);
+	return kmalloc_node((unsigned long)data, gfp_flags, nid);
 }
 
 static void
Index: linux-2.6.16-rc1+critical_mempools/drivers/md/dm-raid1.c
===================================================================
--- linux-2.6.16-rc1+critical_mempools.orig/drivers/md/dm-raid1.c
+++ linux-2.6.16-rc1+critical_mempools/drivers/md/dm-raid1.c
@@ -122,9 +122,9 @@ static inline sector_t region_to_sector(
 /* FIXME move this */
 static void queue_bio(struct mirror_set *ms, struct bio *bio, int rw);
 
-static void *region_alloc(gfp_t gfp_mask, void *pool_data)
+static void *region_alloc(gfp_t gfp_mask, int nid, void *pool_data)
 {
-	return kmalloc(sizeof(struct region), gfp_mask);
+	return kmalloc_node(sizeof(struct region), gfp_mask, nid);
 }
 
 static void region_free(void *element, void *pool_data)
Index: linux-2.6.16-rc1+critical_mempools/drivers/s390/scsi/zfcp_aux.c
===================================================================
--- linux-2.6.16-rc1+critical_mempools.orig/drivers/s390/scsi/zfcp_aux.c
+++ linux-2.6.16-rc1+critical_mempools/drivers/s390/scsi/zfcp_aux.c
@@ -832,9 +832,9 @@ zfcp_unit_dequeue(struct zfcp_unit *unit
 }
 
 static void *
-zfcp_mempool_alloc(gfp_t gfp_mask, void *size)
+zfcp_mempool_alloc(gfp_t gfp_mask, int nid, void *size)
 {
-	return kmalloc((size_t) size, gfp_mask);
+	return kmalloc_node((size_t) size, gfp_mask, nid);
 }
 
 static void
Index: linux-2.6.16-rc1+critical_mempools/drivers/md/dm-io.c
===================================================================
--- linux-2.6.16-rc1+critical_mempools.orig/drivers/md/dm-io.c
+++ linux-2.6.16-rc1+critical_mempools/drivers/md/dm-io.c
@@ -32,9 +32,9 @@ struct io {
 static unsigned _num_ios;
 static mempool_t *_io_pool;
 
-static void *alloc_io(gfp_t gfp_mask, void *pool_data)
+static void *alloc_io(gfp_t gfp_mask, int nid, void *pool_data)
 {
-	return kmalloc(sizeof(struct io), gfp_mask);
+	return kmalloc_node(sizeof(struct io), gfp_mask, nid);
 }
 
 static void free_io(void *element, void *pool_data)
Index: linux-2.6.16-rc1+critical_mempools/drivers/md/bitmap.c
===================================================================
--- linux-2.6.16-rc1+critical_mempools.orig/drivers/md/bitmap.c
+++ linux-2.6.16-rc1+critical_mempools/drivers/md/bitmap.c
@@ -90,9 +90,9 @@ int bitmap_active(struct bitmap *bitmap)
 
 #define WRITE_POOL_SIZE 256
 /* mempool for queueing pending writes on the bitmap file */
-static void *write_pool_alloc(gfp_t gfp_flags, void *data)
+static void *write_pool_alloc(gfp_t gfp_flags, int nid, void *data)
 {
-	return kmalloc(sizeof(struct page_list), gfp_flags);
+	return kmalloc_node(sizeof(struct page_list), gfp_flags, nid);
 }
 
 static void write_pool_free(void *ptr, void *data)
@@ -1565,7 +1565,7 @@ int bitmap_create(mddev_t *mddev)
 	INIT_LIST_HEAD(&bitmap->complete_pages);
 	init_waitqueue_head(&bitmap->write_wait);
 	bitmap->write_pool = mempool_create(WRITE_POOL_SIZE, write_pool_alloc,
-				write_pool_free, NULL);
+					    write_pool_free, NULL);
 	err = -ENOMEM;
 	if (!bitmap->write_pool)
 		goto error;
Index: linux-2.6.16-rc1+critical_mempools/fs/bio.c
===================================================================
--- linux-2.6.16-rc1+critical_mempools.orig/fs/bio.c
+++ linux-2.6.16-rc1+critical_mempools/fs/bio.c
@@ -1122,9 +1122,9 @@ struct bio_pair *bio_split(struct bio *b
 	return bp;
 }
 
-static void *bio_pair_alloc(gfp_t gfp_flags, void *data)
+static void *bio_pair_alloc(gfp_t gfp_flags, int nid, void *data)
 {
-	return kmalloc(sizeof(struct bio_pair), gfp_flags);
+	return kmalloc_node(sizeof(struct bio_pair), gfp_flags, nid);
 }
 
 static void bio_pair_free(void *bp, void *data)
@@ -1149,7 +1149,7 @@ static int biovec_create_pools(struct bi
 			pool_entries >>= 1;
 
 		*bvp = mempool_create(pool_entries, mempool_alloc_slab,
-					mempool_free_slab, bp->slab);
+				      mempool_free_slab, bp->slab);
 		if (!*bvp)
 			return -ENOMEM;
 	}
@@ -1188,7 +1188,7 @@ struct bio_set *bioset_create(int bio_po
 
 	memset(bs, 0, sizeof(*bs));
 	bs->bio_pool = mempool_create(bio_pool_size, mempool_alloc_slab,
-			mempool_free_slab, bio_slab);
+				      mempool_free_slab, bio_slab);
 
 	if (!bs->bio_pool)
 		goto bad;
@@ -1252,8 +1252,8 @@ static int __init init_bio(void)
 	if (!fs_bio_set)
 		panic("bio: can't allocate bios\n");
 
-	bio_split_pool = mempool_create(BIO_SPLIT_ENTRIES,
-				bio_pair_alloc, bio_pair_free, NULL);
+	bio_split_pool = mempool_create(BIO_SPLIT_ENTRIES, bio_pair_alloc,
+					    bio_pair_free, NULL);
 	if (!bio_split_pool)
 		panic("bio: can't create split pool\n");
 

--

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2006-01-25 21:37 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060125161321.647368000@localhost.localdomain>
2006-01-25 19:39 ` [patch 1/9] mempool - Add page allocator Matthew Dobson
2006-01-25 19:39 ` [patch 2/9] mempool - Use common mempool " Matthew Dobson
2006-01-25 19:40 ` [patch 4/9] mempool - Update mempool page allocator user Matthew Dobson
2006-01-25 19:40 ` Matthew Dobson [this message]
2006-01-25 19:40 ` [patch 6/9] mempool - Update kzalloc mempool users Matthew Dobson
2006-01-26  7:30   ` Pekka Enberg
2006-01-26 22:03     ` Matthew Dobson
2006-01-25 19:40 ` [patch 8/9] slab - Add *_mempool slab variants Matthew Dobson
2006-01-26  7:41   ` Pekka Enberg
2006-01-26 22:40     ` Matthew Dobson
2006-01-27  7:09       ` Pekka J Enberg
2006-01-27  7:10       ` Pekka J Enberg
2006-01-25 19:40 ` [patch 9/9] slab - Implement single mempool backing for slab allocator Matthew Dobson
2006-01-26  8:11   ` Pekka Enberg
2006-01-26 22:48     ` Matthew Dobson
2006-01-27  7:22       ` Pekka J Enberg
2006-01-25 23:51 ` [patch 1/9] mempool - Add page allocator Matthew Dobson
2006-01-25 23:51 ` [patch 3/9] mempool - Make mempools NUMA aware Matthew Dobson
2006-01-26 17:54   ` Christoph Lameter
2006-01-26 22:57     ` Matthew Dobson
2006-01-26 23:15       ` Christoph Lameter
2006-01-26 23:24         ` Matthew Dobson
2006-01-26 23:29           ` Christoph Lameter
2006-01-27  0:15             ` Matthew Dobson
2006-01-27  0:21               ` Christoph Lameter
2006-01-27  0:34                 ` Matthew Dobson
2006-01-27  0:39                   ` Christoph Lameter
2006-01-27  0:44                     ` Matthew Dobson
2006-01-27  0:57                       ` Christoph Lameter
2006-01-27  1:07                         ` Andi Kleen
2006-01-27 10:51                   ` Paul Jackson
2006-01-28  1:00                     ` Matthew Dobson
2006-01-28  5:08                       ` Paul Jackson
2006-01-28  8:16                       ` Pavel Machek
2006-01-28 16:14                         ` Sridhar Samudrala
2006-01-28 16:41                           ` Pavel Machek
2006-01-28 16:53                             ` Sridhar Samudrala
2006-01-28 22:59                               ` Pavel Machek
2006-01-28 23:10                                 ` Let the flames begin... [was Re: [patch 3/9] mempool - Make mempools NUMA aware] Pavel Machek
2006-01-27  0:23   ` [patch 3/9] mempool - Make mempools NUMA aware Benjamin LaHaise
2006-01-27  0:35     ` Matthew Dobson
2006-01-27  3:23       ` Benjamin LaHaise
2006-01-28  1:08         ` Matthew Dobson
2006-01-25 23:51 ` [patch 7/9] mempool - Update other mempool users Matthew Dobson

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=1138218010.2092.5.camel@localhost.localdomain \
    --to=colpatch@us.ibm.com \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pavel@suse.cz \
    --cc=sri@us.ibm.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox