[LTP] [PATCH] lib: rewrite cgroup_find_ctrl with using for_each_ctrl
Li Wang
liwang@redhat.com
Tue Jan 18 10:02:04 CET 2022
Richard Palethorpe <rpalethorpe@suse.de> wrote:
> > It is safe to start from controllers[0] to traverse each of
> > the controller whatever V2 or V1, then we can make use of it
> > in the cgroup_find_ctrl() function.
>
> Right, it seems we never set ctrl_root on "cgroup" nor is it added to
> ctrl_field. So it will be skipped in other loops. This might not be what
> people expect, but I'm not sure what to do about that.
Yes, but that's fine. It's because of the difference between V1 and V2.
> >
> > /* Determine if a mounted cgroup hierarchy is unique and record it if so.
>
> Nice simplification!
>
> Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>
Thanks for the review, I will merge this after the new release.
--
Regards,
Li Wang
More information about the ltp
mailing list