QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
543 stars 48 forks source link

qubesd should batch calls to LVM2 #7224

Open DemiMarie opened 2 years ago

DemiMarie commented 2 years ago

How to file a helpful issue

The problem you're addressing (if any)

qubesd makes repeated calls to LVM2 CLI commands with the same arguments

The solution you'd like

If a request for information from LVM2 is made while waiting on the result of the same command, avoid the duplicate call.

The value to a user, and who that user might be

All users who use the LVM pool will benefit from improved performance.

marmarek commented 2 years ago

In practice, this is about lvs calls. QubesOS/qubes-core-admin#427 had some improvements in this regard (not calling lvs if nothing has changed since the previous call), but more can be done. Basically, qubesd keeps a cache of basic info about the LVM volumes. When anything changes, it refreshes the (whole) cache. What can be done, is invalidation on per-volume basis - for example, if just info about 'private' volume has changed, no need to refresh the cache to get info about 'root' volume. Theoretically, this could reduce the number of lvs calls to one on VM startup/shutdown.

But this requires rather intrusive change to how the cache is used - consider refreshing it just before getting the data from it, instead of after changing anything. That said, I think it's worth doing it.

-- Best Regards, Marek Marczykowski-Górecki Invisible Things Lab