fio: Add to cgroup if parameter "cgroup" is enabled.
authorTao Ma <boyu.mt@taobao.com>
Thu, 26 Apr 2012 10:15:46 +0000 (12:15 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 26 Apr 2012 10:15:46 +0000 (12:15 +0200)
Currently, we only add the tasks to cgroup if cgroup_weight is set by
the user. But if we want to test other blkcg parameters like block
throttle, the fio tasks isn't added to the corresponding cgroup and
it doesn't make sense.

So add the task to the corresponding cgroup if the cgroup name is given.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c

index f4bc553b0a5ee9dab880685f1844221975d4c64f..e1dc0ac8b154a662866eea6ecc381921f5000cf0 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1055,7 +1055,7 @@ static void *thread_main(void *data)
                }
        }
 
-       if (td->o.cgroup_weight && cgroup_setup(td, cgroup_list, &cgroup_mnt))
+       if (td->o.cgroup && cgroup_setup(td, cgroup_list, &cgroup_mnt))
                goto err;
 
        errno = 0;