* [PATCH 3/5] CFQ: rename ioc_data to last_cic
@ 2011-06-05 16:26 Paul Bolle
2011-06-06 3:02 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Paul Bolle @ 2011-06-05 16:26 UTC (permalink / raw)
To: Jens Axboe; +Cc: Paul E. McKenney, Vivek Goyal, linux-kernel
Set its type to struct cfq_io_context too.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
block/blk-ioc.c | 2 +-
block/cfq-iosched.c | 10 +++++-----
include/linux/iocontext.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 430945c..998fa67 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -95,7 +95,7 @@ struct io_context *alloc_io_context(gfp_t gfp_flags, int node)
ret->nr_batch_requests = 0; /* because this is 0 */
INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH);
INIT_HLIST_HEAD(&ret->cic_hlist);
- ret->ioc_data = NULL;
+ ret->last_cic = NULL;
}
return ret;
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 89ff2e7..39e4d01 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2704,8 +2704,8 @@ static void __cfq_exit_single_io_context(struct cfq_data *cfqd,
smp_wmb();
cic->key = cfqd_dead_key(cfqd);
- if (ioc->ioc_data == cic)
- rcu_assign_pointer(ioc->ioc_data, NULL);
+ if (ioc->last_cic == cic)
+ rcu_assign_pointer(ioc->last_cic, NULL);
if (cic->cfqq[BLK_RW_ASYNC]) {
cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]);
@@ -3012,7 +3012,7 @@ cfq_drop_dead_cic(struct cfq_data *cfqd, struct io_context *ioc,
spin_lock_irqsave(&ioc->lock, flags);
- BUG_ON(ioc->ioc_data == cic);
+ BUG_ON(ioc->last_cic == cic);
radix_tree_delete(&ioc->radix_root, cfqd->cic_index);
hlist_del_rcu(&cic->cic_node);
@@ -3035,7 +3035,7 @@ cfq_cic_lookup(struct cfq_data *cfqd, struct io_context *ioc)
/*
* we maintain a last-hit cache, to avoid browsing over the tree
*/
- cic = rcu_dereference(ioc->ioc_data);
+ cic = rcu_dereference(ioc->last_cic);
if (cic && cic->key == cfqd) {
rcu_read_unlock();
return cic;
@@ -3053,7 +3053,7 @@ cfq_cic_lookup(struct cfq_data *cfqd, struct io_context *ioc)
}
spin_lock_irqsave(&ioc->lock, flags);
- rcu_assign_pointer(ioc->ioc_data, cic);
+ rcu_assign_pointer(ioc->last_cic, cic);
spin_unlock_irqrestore(&ioc->lock, flags);
break;
} while (1);
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index f560b84..308678b 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -53,7 +53,7 @@ struct io_context {
struct radix_tree_root radix_root;
struct hlist_head cic_hlist;
- void __rcu *ioc_data;
+ struct cfq_io_context __rcu *last_cic;
};
static inline struct io_context *ioc_task_link(struct io_context *ioc)
--
1.7.5.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 3/5] CFQ: rename ioc_data to last_cic
2011-06-05 16:26 [PATCH 3/5] CFQ: rename ioc_data to last_cic Paul Bolle
@ 2011-06-06 3:02 ` Jens Axboe
2011-06-06 19:13 ` Paul Bolle
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2011-06-06 3:02 UTC (permalink / raw)
To: Paul Bolle; +Cc: Paul E. McKenney, Vivek Goyal, linux-kernel
On 2011-06-05 18:26, Paul Bolle wrote:
> Set its type to struct cfq_io_context too.
It's really io scheduler agnostic, but cfq is the only user. Lets leave
the flexibility there.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/5] CFQ: rename ioc_data to last_cic
2011-06-06 3:02 ` Jens Axboe
@ 2011-06-06 19:13 ` Paul Bolle
0 siblings, 0 replies; 3+ messages in thread
From: Paul Bolle @ 2011-06-06 19:13 UTC (permalink / raw)
To: Jens Axboe; +Cc: Paul E. McKenney, Vivek Goyal, linux-kernel
On Mon, 2011-06-06 at 05:02 +0200, Jens Axboe wrote:
> It's really io scheduler agnostic, but cfq is the only user. Lets leave
> the flexibility there.
So that agnosticism and flexibility is unused right now. This might
again have to do with my perspective, but understanding that
ioc->ioc_data
(which really is rather opaque) basically meant (something like)
ioc->cic_last
was a bit of an eye opener for me. But you have to maintain this code,
which makes this your decision, obviously.
Paul Bolle
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-06 19:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-05 16:26 [PATCH 3/5] CFQ: rename ioc_data to last_cic Paul Bolle
2011-06-06 3:02 ` Jens Axboe
2011-06-06 19:13 ` Paul Bolle
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).