New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/lib/qubes/udev-block-add-change calling xenstore-ls is way too slow #3291

Closed
qubesuser opened this Issue Nov 8, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@qubesuser

qubesuser commented Nov 8, 2017

Qubes OS version:

R4.0-rc2

Steps to reproduce the behavior:

  1. Start 20-50 qubes VMs
  2. Keep "top" running
  3. Run "sudo udevadm trigger" (or create a new VM with qvm-create, for a lesser effect)

Expected behavior:

xenstored and xenstore-ls do not appear in "top"

Actual behavior:

xenstored is at 100% time for several seconds in qvm-create and potentially minutes in udevadm trigger with multiple xenstore-ls running and taking a lot of CPU time.

General notes:

xenstore-ls is just too inefficient to call from /usr/lib/qubes/udev-block-add-change

It needs to be replaced with a much faster way to tell if a device is attached, or an algorithm change that doesn't require to determine whether devices are attached at this point.

Proposed optimization at QubesOS/qubes-linux-utils#24 . While that pull request should make it much faster, it still requires an O(n) scan, making "udevadm trigger" O(n^2), which is not good.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 22, 2017

Member

PR proposed by @qubesuser makes it good enough.

Member

marmarek commented Dec 22, 2017

PR proposed by @qubesuser makes it good enough.

@marmarek marmarek closed this Dec 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment