Re: [PATCH 3/3] cgroup: Try to use blkio.bfq.weight if blkio.weight is not available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 27 Aug 2020 at 13:26, Andreas Herrmann <aherrmann@xxxxxxxx> wrote:
>
> Newer kernels just provide blkio.bfq.weight for blkio contoller. Try
> to use this attribute when legacy file is not available.
>
> Signed-off-by: Andreas Herrmann <aherrmann@xxxxxxxx>
> ---
>  cgroup.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/cgroup.c b/cgroup.c
> index 43513733..6edb5b14 100644
> --- a/cgroup.c
> +++ b/cgroup.c
> @@ -218,8 +218,14 @@ int cgroup_setup(struct thread_data *td, struct flist_head *clist, struct cgroup
>                 }
>                 if (write_int_to_file(td, root, "blkio.weight",
>                                         td->o.cgroup_weight,
> -                                       "cgroup open weight"))
> -                       goto err;
> +                                       "cgroup open blkio.weight")) {
> +                       td_clear_error(td);
> +                       log_err("Trying to use blkio.bfq.weight\n");

It doesn't feel right to print an error just because you tried a
fallback. Maybe try both and print an error if neither works?

> +                       if (write_int_to_file(td, root, "blkio.bfq.weight",
> +                                               td->o.cgroup_weight,
> +                                               "cgroup open blkio.bfq.weight"))
> +                               goto err;
> +               }
>         }
>
>         if (!cgroup_write_pid(td, root, (*mnt)->cgroup2)) {
> --
> 2.28.0
>


-- 
Sitsofe | http://sucs.org/~sits/



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux