aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo2012-03-05 15:15:26 -0600
committerJens Axboe2012-03-06 14:27:24 -0600
commitf6e8d01bee036460e03bd4f6a79d014f98ba712e (patch)
treeacaaab3667e0450f0f05464426c3540c89ce4e18 /block/cfq-iosched.c
parent3d48749d93a3dce732dd30a14002ab90ec4355f3 (diff)
downloadkernel-common-f6e8d01bee036460e03bd4f6a79d014f98ba712e.tar.gz
kernel-common-f6e8d01bee036460e03bd4f6a79d014f98ba712e.tar.xz
kernel-common-f6e8d01bee036460e03bd4f6a79d014f98ba712e.zip
block: add io_context->active_ref
Currently ioc->nr_tasks is used to decide two things - whether an ioc is done issuing IOs and whether it's shared by multiple tasks. This patch separate out the first into ioc->active_ref, which is acquired and released using {get|put}_io_context_active() respectively. This will be used to associate bio's with a given task. This patch doesn't introduce any visible behavior change. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 9e386d9bcb7..9a4eac490e0 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1865,7 +1865,7 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
1865 * task has exited, don't wait 1865 * task has exited, don't wait
1866 */ 1866 */
1867 cic = cfqd->active_cic; 1867 cic = cfqd->active_cic;
1868 if (!cic || !atomic_read(&cic->icq.ioc->nr_tasks)) 1868 if (!cic || !atomic_read(&cic->icq.ioc->active_ref))
1869 return; 1869 return;
1870 1870
1871 /* 1871 /*
@@ -2841,7 +2841,7 @@ cfq_update_idle_window(struct cfq_data *cfqd, struct cfq_queue *cfqq,
2841 2841
2842 if (cfqq->next_rq && (cfqq->next_rq->cmd_flags & REQ_NOIDLE)) 2842 if (cfqq->next_rq && (cfqq->next_rq->cmd_flags & REQ_NOIDLE))
2843 enable_idle = 0; 2843 enable_idle = 0;
2844 else if (!atomic_read(&cic->icq.ioc->nr_tasks) || 2844 else if (!atomic_read(&cic->icq.ioc->active_ref) ||
2845 !cfqd->cfq_slice_idle || 2845 !cfqd->cfq_slice_idle ||
2846 (!cfq_cfqq_deep(cfqq) && CFQQ_SEEKY(cfqq))) 2846 (!cfq_cfqq_deep(cfqq) && CFQQ_SEEKY(cfqq)))
2847 enable_idle = 0; 2847 enable_idle = 0;