RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1970830 - [cgroup] 'blkiotune --weight' will set a wrong value to io.bfq.weight
Summary: [cgroup] 'blkiotune --weight' will set a wrong value to io.bfq.weight
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: Documentation
Version: 9.0
Hardware: All
OS: Linux
high
high
Target Milestone: beta
: ---
Assignee: Jiri Herrmann
QA Contact:
Parth Shah
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-11 10:00 UTC by yisun
Modified: 2024-11-11 15:55 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
.`virsh blkiotune --weight` command fails to set the correct cgroup I/O controller value Currently, using the `virsh blkiotune --weight` command to set the VM weight does not work as expected. The command fails to set the correct `io.bfq.weight` value in the cgroup I/O controller interface file. There is no workaround at this time.
Clone Of:
Environment:
Last Closed: 2023-05-26 13:37:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yisun 2021-06-11 10:00:28 UTC
Description:
[cgroup] 'blkiotune --weight' will set a wrong value to io.bfq.weight

Versions:
libvirt-7.4.0-1.el9.x86_64
systemd-248-5.el9.x86_64

How reproducible:
100%

Steps:
1. have a running vm = 'vm1'
2. Set its weight to 119
[root@libvirt-rhel-9 ~]# virsh blkiotune vm1 --weight 119

ERROR HAPPENS HERE: we got a 12 but not a 119 in xml/blkiotune/cgroup

[root@libvirt-rhel-9 ~]# virsh dumpxml vm1 | grep weight
    <weight>12</weight>

[root@libvirt-rhel-9 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2dvm1.scope/io.bfq.weight 
default 12

[root@libvirt-rhel-9 ~]# virsh blkiotune vm1
weight         : 12

3. try some other values, all incorrect
[root@libvirt-rhel-9 ~]# virsh blkiotune vm1 --weight 131

[root@libvirt-rhel-9 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2dvm1.scope/io.bfq.weight 
default 14

[root@libvirt-rhel-9 ~]# virsh blkiotune vm1 --weight 9

[root@libvirt-rhel-9 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2dvm1.scope/io.bfq.weight 
default 1

Expected result:
cgroup io.bfq.weight should be set as the blkiotune cmd

Actual result:
It's quite like follow a logic:
cgroup_io_bfq_weight = math.ceil(blkiotune_cmd_weight/10)

Comment 2 Pavel Hrdina 2021-06-17 14:16:59 UTC
Unfortunately there is nothing we can do in libvirt to fix this.

In order to set the IO weight for VMs in RHEL properly we have to use systemd DBus APIs. Libvirt properly calls the API with the value requested by user. After that it's up to systemd to write the value to the io.bfq.weight file.

Until systemd 248 it was doing exactly that, however there was an issue with that approach. In kernel io.weight has range [1, 10000] but that interface file is not currently present, instead we have io.bfq.weight which has different range [1, 1000] but both are controlled using the same IOWeight systemd property because the io.bfq.weight should be eventually removed and io.weight will be used. Because of all this there is no simple solution to the messed up situation. If user would requested IO weight larger then 1000 it would fail so systemd starting with version 248 coverts the value to fit withing the smaller range.

This will be most likely fixed once we will get rid of the io.bfq.weight and we will have only io.weight, but I don't know when that happens.

From libvirt POV we can only document this unfortunate behavior.

Comment 4 yalzhang@redhat.com 2022-11-14 01:34:39 UTC
According to comment 2, move this bug to documentation.


Note You need to log in before you can comment on or make changes to this bug.