diff options
author | Jens Axboe <axboe@suse.de> | 2006-07-19 17:39:40 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:29:39 -0400 |
commit | b5deef901282628d88c784f4c9d2f0583ec3b355 (patch) | |
tree | 1d3be92f18c9afd9426b06739c8f76931acbf03f /block/cfq-iosched.c | |
parent | a3b05e8f58c95dfccbf2c824d0c68e5990571f24 (diff) |
[PATCH] Make sure all block/io scheduler setups are node aware
Some were kmalloc_node(), some were still kmalloc(). Change them all to
kmalloc_node().
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 85f1d87e86d4..0452108a932e 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1148,8 +1148,9 @@ static void cfq_exit_io_context(struct io_context *ioc) | |||
1148 | static struct cfq_io_context * | 1148 | static struct cfq_io_context * |
1149 | cfq_alloc_io_context(struct cfq_data *cfqd, gfp_t gfp_mask) | 1149 | cfq_alloc_io_context(struct cfq_data *cfqd, gfp_t gfp_mask) |
1150 | { | 1150 | { |
1151 | struct cfq_io_context *cic = kmem_cache_alloc(cfq_ioc_pool, gfp_mask); | 1151 | struct cfq_io_context *cic; |
1152 | 1152 | ||
1153 | cic = kmem_cache_alloc_node(cfq_ioc_pool, gfp_mask, cfqd->queue->node); | ||
1153 | if (cic) { | 1154 | if (cic) { |
1154 | memset(cic, 0, sizeof(*cic)); | 1155 | memset(cic, 0, sizeof(*cic)); |
1155 | cic->last_end_request = jiffies; | 1156 | cic->last_end_request = jiffies; |
@@ -1277,11 +1278,11 @@ retry: | |||
1277 | * free memory. | 1278 | * free memory. |
1278 | */ | 1279 | */ |
1279 | spin_unlock_irq(cfqd->queue->queue_lock); | 1280 | spin_unlock_irq(cfqd->queue->queue_lock); |
1280 | new_cfqq = kmem_cache_alloc(cfq_pool, gfp_mask|__GFP_NOFAIL); | 1281 | new_cfqq = kmem_cache_alloc_node(cfq_pool, gfp_mask|__GFP_NOFAIL, cfqd->queue->node); |
1281 | spin_lock_irq(cfqd->queue->queue_lock); | 1282 | spin_lock_irq(cfqd->queue->queue_lock); |
1282 | goto retry; | 1283 | goto retry; |
1283 | } else { | 1284 | } else { |
1284 | cfqq = kmem_cache_alloc(cfq_pool, gfp_mask); | 1285 | cfqq = kmem_cache_alloc_node(cfq_pool, gfp_mask, cfqd->queue->node); |
1285 | if (!cfqq) | 1286 | if (!cfqq) |
1286 | goto out; | 1287 | goto out; |
1287 | } | 1288 | } |
@@ -1407,7 +1408,7 @@ cfq_get_io_context(struct cfq_data *cfqd, gfp_t gfp_mask) | |||
1407 | 1408 | ||
1408 | might_sleep_if(gfp_mask & __GFP_WAIT); | 1409 | might_sleep_if(gfp_mask & __GFP_WAIT); |
1409 | 1410 | ||
1410 | ioc = get_io_context(gfp_mask); | 1411 | ioc = get_io_context(gfp_mask, cfqd->queue->node); |
1411 | if (!ioc) | 1412 | if (!ioc) |
1412 | return NULL; | 1413 | return NULL; |
1413 | 1414 | ||
@@ -1955,7 +1956,7 @@ static void *cfq_init_queue(request_queue_t *q, elevator_t *e) | |||
1955 | struct cfq_data *cfqd; | 1956 | struct cfq_data *cfqd; |
1956 | int i; | 1957 | int i; |
1957 | 1958 | ||
1958 | cfqd = kmalloc(sizeof(*cfqd), GFP_KERNEL); | 1959 | cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL, q->node); |
1959 | if (!cfqd) | 1960 | if (!cfqd) |
1960 | return NULL; | 1961 | return NULL; |
1961 | 1962 | ||
@@ -1970,7 +1971,7 @@ static void *cfq_init_queue(request_queue_t *q, elevator_t *e) | |||
1970 | INIT_LIST_HEAD(&cfqd->empty_list); | 1971 | INIT_LIST_HEAD(&cfqd->empty_list); |
1971 | INIT_LIST_HEAD(&cfqd->cic_list); | 1972 | INIT_LIST_HEAD(&cfqd->cic_list); |
1972 | 1973 | ||
1973 | cfqd->cfq_hash = kmalloc(sizeof(struct hlist_head) * CFQ_QHASH_ENTRIES, GFP_KERNEL); | 1974 | cfqd->cfq_hash = kmalloc_node(sizeof(struct hlist_head) * CFQ_QHASH_ENTRIES, GFP_KERNEL, q->node); |
1974 | if (!cfqd->cfq_hash) | 1975 | if (!cfqd->cfq_hash) |
1975 | goto out_free; | 1976 | goto out_free; |
1976 | 1977 | ||