path: root/block
diff options
authorEric Dumazet <>2006-02-04 23:27:36 -0800
committerLinus Torvalds <>2006-02-05 11:06:51 -0800
commit88a2a4ac6b671a4b0dd5d2d762418904c05f4104 (patch)
tree8c30052a0d7fadec37c785a42a71b28d0a9c5fcf /block
parentcef5076987dd545ac74f4efcf1c962be8eac34b0 (diff)
[PATCH] percpu data: only iterate over possible CPUs
percpu_data blindly allocates bootmem memory to store NR_CPUS instances of cpudata, instead of allocating memory only for possible cpus. As a preparation for changing that, we need to convert various 0 -> NR_CPUS loops to use for_each_cpu(). (The above only applies to users of asm-generic/percpu.h. powerpc has gone it alone and is presently only allocating memory for present CPUs, so it's currently corrupting memory). Signed-off-by: Eric Dumazet <> Cc: "David S. Miller" <> Cc: James Bottomley <> Acked-by: Ingo Molnar <> Cc: Jens Axboe <> Cc: Anton Blanchard <> Acked-by: William Irwin <> Cc: Andi Kleen <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'block')
1 files changed, 1 insertions, 1 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index f9fc07efd2da..e5aad8314585 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3453,7 +3453,7 @@ int __init blk_dev_init(void)
iocontext_cachep = kmem_cache_create("blkdev_ioc",
sizeof(struct io_context), 0, SLAB_PANIC, NULL, NULL);
- for (i = 0; i < NR_CPUS; i++)
+ for_each_cpu(i)
INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i));
open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL);