redhat-performance / tuned

Tuning Profile Delivery Mechanism for Linux
GNU General Public License v2.0
814 stars 178 forks source link

Disk plugin: make hdparm device checks lazy #636

Closed zacikpa closed 4 months ago

zacikpa commented 4 months ago

The disk plugin checks each device for hdparm support during initialization. When using many disk devices, this can lead to unwanted delays in profile application.

This change makes the hdparm check lazy by postponing it to the moment when hdparm is actually needed, i.e., during dynamic tuning or when setting spindown/apm. Each device is checked at most once - the plugin now stores the sets of hdparm-supported devices and hdparm-unsupported devices).

Resolves: RHEL-6891

jmencak commented 4 months ago

Thank you for the PR, @zacikpa ! I tested it and it works as intended. I like this solution, especially the "caching" of hdparm's support for a block device. A couple of nits:

I'd definitely love to see this in the upcoming FDP 24.D (June 5th deadline) release, @yarda .

zacikpa commented 4 months ago

Thanks for the review, @jmencak. I updated the description with the correct plugin name and swapped the two sets for a dictionary.

jmencak commented 4 months ago

Thank you for the changes, Pavol. LGTM and I've also retested this.

yarda commented 4 months ago

LGTM, thanks.