diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2011-05-16 13:24:08 (GMT) |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-05-16 13:24:08 (GMT) |
commit | 70087dc38cc77ca8f46059564c00338777734762 (patch) | |
tree | 2ffd5885a12acb44d90d3c3c1a578387bad94a32 /drivers/ide/ide-park.c | |
parent | 02e352287a40bd456eb78df705bf888bc3161d3f (diff) | |
download | linux-fsl-qoriq-70087dc38cc77ca8f46059564c00338777734762.tar.xz |
blk-throttle: Use task_subsys_state() to determine a task's blkio_cgroup
Currentlly we first map the task to cgroup and then cgroup to
blkio_cgroup. There is a more direct way to get to blkio_cgroup
from task using task_subsys_state(). Use that.
The real reason for the fix is that it also avoids a race in generic
cgroup code. During remount/umount rebind_subsystems() is called and
it can do following with and rcu protection.
cgrp->subsys[i] = NULL;
That means if somebody got hold of cgroup under rcu and then it tried
to do cgroup->subsys[] to get to blkio_cgroup, it would get NULL which
is wrong. I was running into this race condition with ltp running on a
upstream derived kernel and that lead to crash.
So ideally we should also fix cgroup generic code to wait for rcu
grace period before setting pointer to NULL. Li Zefan is not very keen
on introducing synchronize_wait() as he thinks it will slow
down moun/remount/umount operations.
So for the time being atleast fix the kernel crash by taking a more
direct route to blkio_cgroup.
One tester had reported a crash while running LTP on a derived kernel
and with this fix crash is no more seen while the test has been
running for over 6 days.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/ide/ide-park.c')
0 files changed, 0 insertions, 0 deletions