Message ID | 20181212230959.69975-2-dennis@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add scsi-stress-remove to blktests | expand |
On Wed, Dec 12, 2018 at 06:09:58PM -0500, Dennis Zhou wrote: > This is a prep patch for a new test that will race blkg association and > request_queue cleanup. As blkg association is a underlying cgroup io > controller feature, we need the ability to check if the controller is > available. > > Signed-off-by: Dennis Zhou <dennis@kernel.org> > --- > common/cgroup | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/common/cgroup b/common/cgroup > index d445093..3481458 100644 > --- a/common/cgroup > +++ b/common/cgroup > @@ -37,19 +37,27 @@ _have_cgroup2() > return 0 > } > > -_have_cgroup2_controller_file() > +_have_cgroup2_controller() > { > - _have_cgroup2 || return 1 > - > local controller="$1" > - local file="$2" > - local dir > + > + _have_cgroup2 || return 1 > > dir="$(_cgroup2_base_dir)" > + > if ! grep -q "$controller" "$dir/cgroup.controllers"; then > SKIP_REASON="no support for $controller cgroup controller; if it is enabled, you may need to boot with cgroup_no_v1=$controller" > return 1 > fi > +} > + > +_have_cgroup2_controller_file() > +{ > + local controller="$1" > + local file="$2" > + local dir > + > + _have_cgroup_2_controller "$controller" || return 1 This should be _have_cgroup2_controller. I'll fix it when I apply it. > > mkdir "$dir/blktests" > echo "+$controller" > "$dir/cgroup.subtree_control" > -- > 2.17.1 >
diff --git a/common/cgroup b/common/cgroup index d445093..3481458 100644 --- a/common/cgroup +++ b/common/cgroup @@ -37,19 +37,27 @@ _have_cgroup2() return 0 } -_have_cgroup2_controller_file() +_have_cgroup2_controller() { - _have_cgroup2 || return 1 - local controller="$1" - local file="$2" - local dir + + _have_cgroup2 || return 1 dir="$(_cgroup2_base_dir)" + if ! grep -q "$controller" "$dir/cgroup.controllers"; then SKIP_REASON="no support for $controller cgroup controller; if it is enabled, you may need to boot with cgroup_no_v1=$controller" return 1 fi +} + +_have_cgroup2_controller_file() +{ + local controller="$1" + local file="$2" + local dir + + _have_cgroup_2_controller "$controller" || return 1 mkdir "$dir/blktests" echo "+$controller" > "$dir/cgroup.subtree_control"
This is a prep patch for a new test that will race blkg association and request_queue cleanup. As blkg association is a underlying cgroup io controller feature, we need the ability to check if the controller is available. Signed-off-by: Dennis Zhou <dennis@kernel.org> --- common/cgroup | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)