]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_scrub.service: reduce background CPU usage to less than one core if possible
authorDarrick J. Wong <djwong@kernel.org>
Mon, 29 Jul 2024 23:23:15 +0000 (16:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:09 +0000 (17:01 -0700)
commit4b1ec6e0b5b83128b4b0c4e32cef7e7f27be85a1
tree2452903fc48986fe80b2d4d8a65e11c0a2027294
parent18104b318ca9b3bb13dc901371272b46e1fb2669
xfs_scrub.service: reduce background CPU usage to less than one core if possible

Currently, the xfs_scrub background service is configured to use -b,
which means that the program runs completely serially.  However, even
using all of one CPU core with idle priority may be enough to cause
thermal throttling and unwanted fan noise on smaller systems (e.g.
laptops) with fast IO systems.

Let's try to avoid this (at least on systemd) by using cgroups to limit
the program's usage to slghtly more than half of one CPU and lowering
the nice priority in the scheduler.  What we /really/ want is to run
steadily on an efficiency core, but there doesn't seem to be a means to
ask the scheduler not to ramp up the CPU frequency for a particular
task.

While we're at it, group the resource limit directives together.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/Makefile
scrub/system-xfs_scrub.slice [new file with mode: 0644]
scrub/xfs_scrub@.service.in
scrub/xfs_scrub_all.service.in
scrub/xfs_scrub_fail@.service.in