aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-12-14 00:33:38 +0100
committerZiyan <jaraidaniel@gmail.com>2016-01-08 10:36:53 +0100
commitc1cff5fe466e4d89008725d84f76f635b7f863a6 (patch)
tree2fa27d5ab7b7f27e226fdbb19cd1aa7e6808ab2f /fs
parent66fa8acc4245de17273acee0c9527dead751e99a (diff)
downloadkernel_samsung_tuna-c1cff5fe466e4d89008725d84f76f635b7f863a6.zip
kernel_samsung_tuna-c1cff5fe466e4d89008725d84f76f635b7f863a6.tar.gz
kernel_samsung_tuna-c1cff5fe466e4d89008725d84f76f635b7f863a6.tar.bz2
block, cfq: move ioc ioprio/cgroup changed handling to cic
ioprio/cgroup change was handled by marking the changed state in ioc and, on the following access to the ioc, performing RCU-protected iteration through all cic's grabbing the matching queue_lock. This patch moves the changed state to each cic. When ioprio or cgroup changes, the respective bit is set on all cic's of the ioc and when each of those cic (not ioc) is accessed, change is applied for that specific ioc-queue pair. This also fixes the following two race conditions between setting and clearing of changed states. * Missing barrier between assign/load of ioprio and ioprio_changed allowed applying old ioprio. * Change requests could happen between application of change and clearing of changed variables. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/ioprio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ioprio.c b/fs/ioprio.c
index a4cb730..f8d8429 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -49,8 +49,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio)
ioc = get_task_io_context(task, GFP_ATOMIC, NUMA_NO_NODE);
if (ioc) {
- ioc->ioprio = ioprio;
- ioc->ioprio_changed = 1;
+ ioc_ioprio_changed(ioc, ioprio);
put_io_context(ioc);
}