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

Bug #1833660 reported by kkm
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gce-compute-image-packages (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
Disco
Fix Released
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)
description: updated
Balint Reczey (rbalint)
description: updated
Revision history for this message
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
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

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
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
Brian Murray (brian-murray) wrote : [gce-compute-image-packages/disco] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for disco for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
kkm (m88ez2fnn72x) wrote :

Sorry Brian, I managed to miss the original notification. I'll check all 3 distros right now on the GCE.

Changed in gce-compute-image-packages (Ubuntu Bionic):
status: Fix Committed → Confirmed
Revision history for this message
kkm (m88ez2fnn72x) wrote :
Revision history for this message
kkm (m88ez2fnn72x) wrote :
Changed in gce-compute-image-packages (Ubuntu Xenial):
status: Fix Committed → Confirmed
status: Confirmed → Fix Committed
Changed in gce-compute-image-packages (Ubuntu Bionic):
status: Confirmed → Fix Committed
tags: added: verification-done-bionic verification-done-xenial
removed: verification-needed-bionic verification-needed-xenial
Revision history for this message
kkm (m88ez2fnn72x) wrote :

Sorry about messing with the status. I should have RTFM twice.

Revision history for this message
kkm (m88ez2fnn72x) wrote :
tags: added: verification-done-disco
removed: removal-candidate verification-needed verification-needed-disco
Revision history for this message
kkm (m88ez2fnn72x) wrote :

All three distros are fixed, thanks!

What about Eoan? Does it need this fix, too?

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
gce-compute-image-packages (20190801-0ubuntu1~19.04.0) disco; urgency=medium

  * Rebuild for Disco

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)

gce-compute-image-packages (20190522-0ubuntu2) eoan; urgency=medium

  * Rebuild against new libjson-c4.

 -- Balint Reczey <email address hidden> Thu, 15 Aug 2019 21:56:05 +0200

Changed in gce-compute-image-packages (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for gce-compute-image-packages has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
gce-compute-image-packages (20190801-0ubuntu1~18.04.0) bionic; urgency=medium

  * Rebuild for Bionic

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)

gce-compute-image-packages (20190522-0ubuntu2) eoan; urgency=medium

  * Rebuild against new libjson-c4.

 -- Balint Reczey <email address hidden> Thu, 15 Aug 2019 21:57:58 +0200

Changed in gce-compute-image-packages (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
gce-compute-image-packages (20190801-0ubuntu1~16.04.0) xenial; urgency=medium

  * Rebuild for Xenial
  * Refresh patches

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)

gce-compute-image-packages (20190522-0ubuntu2) eoan; urgency=medium

  * Rebuild against new libjson-c4.

 -- Balint Reczey <email address hidden> Thu, 15 Aug 2019 22:05:03 +0200

Changed in gce-compute-image-packages (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.