/lib/udev/rules.d/99-gce.rules tries to apply 'scheduler=none' to partitions

Bug #1833660 reported by kkm on 2019-06-21
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gce-compute-image-packages (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned

Bug Description

[Impact]

 * The following messages can be observed in the journal:

systemd-udevd[1876]: sda14: Failed to open ATTR{/sys/devices/pci0000:00/0000:00:03.0/virtio0/host0/target0:0:1/0:0:1:0/block/sda/sda14/queue/scheduler} for writing: No such file or directory
 * This is not harmful, but annoying and does not show how we thrive to provide amazing experience with Ubuntu.

[Test Case]

 * Run parted then exit:
   $ echo p | sudo parted
 * Observe the "Failed to open ATTR" messages not appearing in the journal in fixed versions.
   $ journalctl -a
   ...

[Regression Potential]

 * Absolutely minimal, the fix just adds a filter to not change scheduler on partitions.

[Original Bug Text]

Xfer: https://github.com/GoogleCloudPlatform/compute-image-packages/issues/783

I initially reported the bug there, but it appears the file is owned by you guys?

I see this bug in Google Cloud images of 18.04 in --image=ubuntu-1804-bionic-v20190514 --image-project=gce-uefi-images.

What happens is, the image contains the file /lib/udev/rules.d/99-gce.rules with the following rule:

# Switch to using NOOP as the default scheduler per GCE request
SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_VENDOR}=="*Google*", ATTR{queue/scheduler}="noop"

The rule matches both devices (/sda) and partitions (/sda1), but the scheduler is a device property and does not apply to partition. These lines are logged multiple times during the first boot of the image, when the partition and the filesystem is grown, and once on every subsequent boot, once per every partition:

    Jun 3 04:46:49 toy-sec-1 systemd-udevd[1442]: error opening ATTR{/sys/devices/pci0000:00/0000:00:03.0/virtio0/host0/target0:0:1/0:0:1:0/block/sda/sda1/queue/scheduler} for writing: No such file or directory
    Jun 3 04:46:49 toy-sec-1 systemd-udevd[1438]: error opening ATTR{/sys/devices/pci0000:00/0000:00:03.0/virtio0/host0/target0:0:1/0:0:1:0/block/sda/sda15/queue/scheduler} for writing: No such file or directory
    Jun 3 04:46:49 toy-sec-1 systemd-udevd[1437]: error opening ATTR{/sys/devices/pci0000:00/0000:00:03.0/virtio0/host0/target0:0:1/0:0:1:0/block/sda/sda14/queue/scheduler} for writing: No such file or directory

To repro, no GCE necessary; you can boot any VM with the guest using the virtio driver, drop in this file, and run e. g. parted, or any program opening the raw device, as it triggers kernel uevents. Start parted, and the messages are logged. Quit parted, and they are logged again.

This issue is harmless, but when you ingest logs, you'd rather have them as error-level message free as possible.

I can think of 3 ways to solve this issue:

1. Make the rule not match partitions. I drop-replace this file in all my images with the following:

    SUBSYSTEM=="block", ENV{DEVTYPE}!="partition", ACTION=="add|change", ENV{ID_VENDOR}=="*Google*", ATTR{queue/scheduler}="noop"

2. Since Ubuntu is providing GCE images, kernel command line option 'elevator=none' sets the I/O scheduler to all applicable devices by default; no udev integration necessary. The default is not locked, so if anyone needs to change it (e. g. for a physical disk directly attached to a VM, not a GCE setup but in a local VM it's possible), they can select a different elevator strategy with udev rules. This is the setting widely recommended by other Linux-based system, e. g. there is a RHEL support page recommending that. It obviously a better choice shift the I/O elevation job to the host, as it handles requests from all guests, and can prioritize I/O much better, as it has all consolidated information available at any moment for the physical device actually doing the block I/O.

3. Since these GCE images come with a special kernel build (it has a '-gcp' version suffix), the default of none can be simply selected at compile time. [STRIKEOUT]It also make sense to compile in virtio into the kernel; as it is, the device is probed from initramfs. Since all VM boot drives are virtio, it is probably a sensible choice to have it compiled-in; definitely so for the GCP-specific kernel build.[/STRIKEOUT] EDIT: Sorry, just noticed virtio IS compiled
into this kernel. But that was a side note besides the main point.

Thanks, you'll probably know better than me which of these (or maybe other options I could not think of right now), as you probably understand all the implications I'm likely unaware of, so I'm just sharing my thoughts on this issue, not preferring any of these.

I did not check other images available from the same GCE project, but I'm sure if the rule is there, the result will be identical--it's a kernel thing, and partitions do not have I/O schedulers by design.

kkm (m88ez2fnn72x) on 2019-06-21
description: updated
Balint Reczey (rbalint) on 2019-08-15
description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gce-compute-image-packages - 20190801-0ubuntu1

---------------
gce-compute-image-packages (20190801-0ubuntu1) eoan; urgency=medium

  * New upstream version 20190801 (LP: #1840245)
    - Add manpages for NSS modules
    - Switch to the v1 Guest Attributes URL
    - Support Google Private Access over IPv6
  * Refresh patches
  * Fix running tests
  * Keep setting multiarch libdir with the changes upstream Makefiles
  * Update shared library symlinks
  * Don't try to set noop scheduler for partitions (LP: #1833660)

 -- Balint Reczey <email address hidden> Thu, 15 Aug 2019 19:36:10 +0200

Changed in gce-compute-image-packages (Ubuntu):
status: New → Fix Released

Hello kkm, or anyone else affected,

Accepted gce-compute-image-packages into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gce-compute-image-packages/20190801-0ubuntu1~19.04.0 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in gce-compute-image-packages (Ubuntu Disco):
status: New → Fix Committed
tags: added: verification-needed verification-needed-disco
Brian Murray (brian-murray) wrote :

Hello kkm, or anyone else affected,

Accepted gce-compute-image-packages into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gce-compute-image-packages/20190801-0ubuntu1~18.04.0 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in gce-compute-image-packages (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed-bionic
Changed in gce-compute-image-packages (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Brian Murray (brian-murray) wrote :

Hello kkm, or anyone else affected,

Accepted gce-compute-image-packages into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gce-compute-image-packages/20190801-0ubuntu1~16.04.0 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers