redhat-performance / tuned

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

daemon: buffer sighup signal #619

Closed yarda closed 1 month ago

yarda commented 3 months ago

Resolves: RHEL-31180

yarda commented 3 months ago

There is no need for atomic test & set or semaphores, because the signal handler is running in one thread thus the worst thing that could happen is that the SIGHUP on the edge of the time interval will be ignored. Nevertheless, the buffer should improve the responsiveness to the SIGHUP.

yarda commented 3 months ago

It would be generally better and much cleaner to do the reloads in the main loop, but it would require bigger code changes.

jmencak commented 3 months ago

Thank you for a quick fix, @yarda ! LGTM I've also tested this and I haven't seen TuneD stuck after it was sent a SIGHUP after cca 800 iterations of our e2e test suite.