Commit 7baf398f authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'cfq-merge' of git://brick.kernel.dk/data/git/linux-2.6-block

* 'cfq-merge' of git://brick.kernel.dk/data/git/linux-2.6-block:
  [BLOCK] cfq-iosched: seek and async performance fixes
  [PATCH] ll_rw_blk: fix 80-col offender in put_io_context()
  [PATCH] cfq-iosched: small cfq_choose_req() optimization
  [PATCH] [BLOCK] cfq-iosched: change cfq io context linking from list to tree
parents 78cd9e04 206dc69b
This diff is collapsed.
......@@ -3539,11 +3539,17 @@ void put_io_context(struct io_context *ioc)
BUG_ON(atomic_read(&ioc->refcount) == 0);
if (atomic_dec_and_test(&ioc->refcount)) {
struct cfq_io_context *cic;
rcu_read_lock();
if (ioc->aic && ioc->aic->dtor)
ioc->aic->dtor(ioc->aic);
if (ioc->cic && ioc->cic->dtor)
ioc->cic->dtor(ioc->cic);
if (ioc->cic_root.rb_node != NULL) {
struct rb_node *n = rb_first(&ioc->cic_root);
cic = rb_entry(n, struct cfq_io_context, rb_node);
cic->dtor(ioc);
}
rcu_read_unlock();
kmem_cache_free(iocontext_cachep, ioc);
......@@ -3556,6 +3562,7 @@ void exit_io_context(void)
{
unsigned long flags;
struct io_context *ioc;
struct cfq_io_context *cic;
local_irq_save(flags);
task_lock(current);
......@@ -3567,8 +3574,10 @@ void exit_io_context(void)
if (ioc->aic && ioc->aic->exit)
ioc->aic->exit(ioc->aic);
if (ioc->cic && ioc->cic->exit)
ioc->cic->exit(ioc->cic);
if (ioc->cic_root.rb_node != NULL) {
cic = rb_entry(rb_first(&ioc->cic_root), struct cfq_io_context, rb_node);
cic->exit(ioc);
}
put_io_context(ioc);
}
......@@ -3598,7 +3607,7 @@ struct io_context *current_io_context(gfp_t gfp_flags)
ret->last_waited = jiffies; /* doesn't matter... */
ret->nr_batch_requests = 0; /* because this is 0 */
ret->aic = NULL;
ret->cic = NULL;
ret->cic_root.rb_node = NULL;
tsk->io_context = ret;
}
......
......@@ -55,25 +55,29 @@ struct as_io_context {
struct cfq_queue;
struct cfq_io_context {
/*
* circular list of cfq_io_contexts belonging to a process io context
*/
struct list_head list;
struct cfq_queue *cfqq[2];
struct rb_node rb_node;
void *key;
struct cfq_queue *cfqq[2];
struct io_context *ioc;
unsigned long last_end_request;
sector_t last_request_pos;
unsigned long last_queue;
unsigned long ttime_total;
unsigned long ttime_samples;
unsigned long ttime_mean;
unsigned int seek_samples;
u64 seek_total;
sector_t seek_mean;
struct list_head queue_list;
void (*dtor)(struct cfq_io_context *);
void (*exit)(struct cfq_io_context *);
void (*dtor)(struct io_context *); /* destructor */
void (*exit)(struct io_context *); /* called on task exit */
};
/*
......@@ -94,7 +98,7 @@ struct io_context {
int nr_batch_requests; /* Number of requests left in the batch */
struct as_io_context *aic;
struct cfq_io_context *cic;
struct rb_root cic_root;
};
void put_io_context(struct io_context *ioc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment