[LTP] [RFC PATCH] tst_cgroup: Avoid mixing mounts V1 and V2 simultaneously

Li Wang liwang@redhat.com
Fri Apr 28 14:56:36 CEST 2023


On Fri, Apr 28, 2023 at 6:24 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > There is a tiny problem with the test logic of this tst_cgroup library,
> > that it potentially mixes Cgroup V1 and V2 together to be mounted at
> > the same time. The scenario happens once people just requests CTRL_BASE
> > (or a V2 controller not enabled) on a only V1-mounted system.
> >
> > Cgroup community always objected to enabling Cgroup like that (V1&V2),
> > which may bring unexpected issues along the way.
> >
> > So this patch cancels LTP mount V1&V2 simultaneously even if there is
> > no overlap in specific controller files.
>
> Isn't this the point of the library, to be able to use mixed V1 and V2
> setup? As far as I understand it the only limitation is that we can bind
> a controllter to either V1 or V2 but not both.
>

That's the original design. We tried to keep flexible but ignored
one exception V1 mounts all controllers and V2 only basic mount.
(No controllers conflict in this mounting).

>From my observation, if a system(e.g. RHEL8) only announces
Cgroup V1 support but does not guarantee V2 to be used.
A test required 'CTRL_BASE' could mount V2 success but
that V2 is only part work and test will get TBROK.
We are unable to say this situation is a bug.

So I suppose here mixed V1 and V2 might not be a good design
unless we find a way to detect if the system fully supports both
versions. But I guess this is difficult to check.



>
> Also as far as I can tell, there is pleny of distributions out there at
> the moment where the default is split between V1 and V2 both mounted at
> the same time.
>

Yes, as long as a distribution announces support for both Cgroup.
This design makes sense for it. But I'm afraid rare people mixed
using both at the same time(and that is also not recommended).

-- 
Regards,
Li Wang


More information about the ltp mailing list