diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 91d1126..45910ce 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -1148,13 +1148,16 @@ static void cfq_put_queue(struct cfq_queue *cfqq) #define CIC_GANG_NR 16 static unsigned int call_for_each_cic(struct io_context *ioc, - void (*func)(struct io_context *, struct cfq_io_context *)) + void (*func)(struct io_context *, struct cfq_io_context *), + int verbose) { struct cfq_io_context *cics[CIC_GANG_NR]; unsigned long index = 0; unsigned int called = 0; int nr; + printk("cfq: entered\n"); + rcu_read_lock(); do { @@ -1167,14 +1170,19 @@ call_for_each_cic(struct io_context *ioc, */ nr = radix_tree_gang_lookup(&ioc->radix_root, (void **) cics, index, CIC_GANG_NR); + if (verbose) + printk("cfq: got %d from %lu\n", nr, index); if (!nr) break; called += nr; index = 1 + (unsigned long) cics[nr - 1]->key; - for (i = 0; i < nr; i++) + for (i = 0; i < nr; i++) { + if (verbose) + printk("cfq: call for %p\n", cics[i]); func(ioc, cics[i]); + } } while (nr == CIC_GANG_NR); rcu_read_unlock(); @@ -1204,7 +1212,7 @@ static void cfq_free_io_context(struct io_context *ioc) * linked into this ioc. So it should be ok to iterate over the known * list, we will see all cic's since no new ones are added. */ - freed = call_for_each_cic(ioc, cic_free_func); + freed = call_for_each_cic(ioc, cic_free_func, 0); elv_ioc_count_mod(ioc_count, -freed); @@ -1267,7 +1275,7 @@ static void cfq_exit_single_io_context(struct io_context *ioc, static void cfq_exit_io_context(struct io_context *ioc) { rcu_assign_pointer(ioc->ioc_data, NULL); - call_for_each_cic(ioc, cfq_exit_single_io_context); + call_for_each_cic(ioc, cfq_exit_single_io_context, 1); } static struct cfq_io_context * @@ -1361,7 +1369,7 @@ static void changed_ioprio(struct io_context *ioc, struct cfq_io_context *cic) static void cfq_ioc_set_ioprio(struct io_context *ioc) { - call_for_each_cic(ioc, changed_ioprio); + call_for_each_cic(ioc, changed_ioprio, 0); ioc->ioprio_changed = 0; }