Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173000
b: refs/heads/master
c: 2461033
h: refs/heads/master
v: v3
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Dec 3, 2009
1 parent eadc2b9 commit ed3ed8c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8682e1f15f26dae9a9e8af794d179055fbd81166
refs/heads/master: 24610333d578478d354144ab4709a203684afc5f
39 changes: 39 additions & 0 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2608,6 +2608,41 @@ static void cfq_init_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq,
cfqq->pid = pid;
}

#ifdef CONFIG_CFQ_GROUP_IOSCHED
static void changed_cgroup(struct io_context *ioc, struct cfq_io_context *cic)
{
struct cfq_queue *sync_cfqq = cic_to_cfqq(cic, 1);
struct cfq_data *cfqd = cic->key;
unsigned long flags;
struct request_queue *q;

if (unlikely(!cfqd))
return;

q = cfqd->queue;

spin_lock_irqsave(q->queue_lock, flags);

if (sync_cfqq) {
/*
* Drop reference to sync queue. A new sync queue will be
* assigned in new group upon arrival of a fresh request.
*/
cfq_log_cfqq(cfqd, sync_cfqq, "changed cgroup");
cic_set_cfqq(cic, NULL, 1);
cfq_put_queue(sync_cfqq);
}

spin_unlock_irqrestore(q->queue_lock, flags);
}

static void cfq_ioc_set_cgroup(struct io_context *ioc)
{
call_for_each_cic(ioc, changed_cgroup);
ioc->cgroup_changed = 0;
}
#endif /* CONFIG_CFQ_GROUP_IOSCHED */

static struct cfq_queue *
cfq_find_alloc_queue(struct cfq_data *cfqd, bool is_sync,
struct io_context *ioc, gfp_t gfp_mask)
Expand Down Expand Up @@ -2840,6 +2875,10 @@ cfq_get_io_context(struct cfq_data *cfqd, gfp_t gfp_mask)
if (unlikely(ioc->ioprio_changed))
cfq_ioc_set_ioprio(ioc);

#ifdef CONFIG_CFQ_GROUP_IOSCHED
if (unlikely(ioc->cgroup_changed))
cfq_ioc_set_cgroup(ioc);
#endif
return cic;
err_free:
cfq_cic_free(cic);
Expand Down

0 comments on commit ed3ed8c

Please sign in to comment.