selinux/policycoreutils
Ondrej Mosnacek 93902fc834 setfiles/restorecon: support parallel relabeling
Use the newly introduced selinux_restorecon_parallel(3) in
setfiles/restorecon and a -T option to both to allow enabling parallel
relabeling. The default behavior without specifying the -T option is to
use 1 thread; parallel relabeling must be requested explicitly by
passing -T 0 (which will use as many threads as there are available CPU
cores) or -T <N>, which will use <N> threads.

=== Benchmarks ===
As measured on a 32-core cloud VM with Fedora 34. Not a fully
representative environment, but still the scaling is quite good.

WITHOUT PATCHES:
$ time restorecon -rn /usr

real    0m21.689s
user    0m21.070s
sys     0m0.494s

WITH PATCHES:
$ time restorecon -rn /usr

real    0m23.940s
user    0m23.127s
sys     0m0.653s
$ time restorecon -rn -T 2 /usr

real    0m13.145s
user    0m25.306s
sys     0m0.695s
$ time restorecon -rn -T 4 /usr

real    0m7.559s
user    0m28.470s
sys     0m1.099s
$ time restorecon -rn -T 8 /usr

real    0m5.186s
user    0m37.450s
sys     0m2.094s
$ time restorecon -rn -T 16 /usr

real    0m3.831s
user    0m51.220s
sys     0m4.895s
$ time restorecon -rn -T 32 /usr

real    0m2.650s
user    1m5.136s
sys     0m6.614s

Note that the benchmarks were performed in read-only mode (-n), so the
labels were only read and looked up in the database, not written. When
fixing labels on a heavily mislabeled system, the scaling would likely
be event better, since a larger % of work could be done in parallel.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2021-11-23 10:03:18 +01:00
..
.tx Update Translations 2013-10-24 13:58:39 -04:00
hll Fix many misspellings 2019-09-18 22:47:35 +02:00
load_policy selinux: Remove legacy local boolean and user code 2019-07-29 23:46:24 +02:00
man selinux_config(5): add a note that runtime disable is deprecated 2020-11-12 21:23:59 +01:00
newrole policycoreutils: mark local functions static 2021-11-15 16:00:54 -05:00
po Fix many misspellings 2019-09-18 22:47:35 +02:00
run_init policycoreutils: mark local functions static 2021-11-15 16:00:54 -05:00
scripts fixfiles: do not exclude /dev and /run in -C mode 2021-05-12 09:36:16 +02:00
secon policycoreutils: silence -Wextra-semi-stmt warning 2021-07-06 11:08:11 -04:00
semodule libselinux/semodule: Improve extracting message 2021-10-06 12:04:03 +02:00
sestatus policycoreutils: mark local functions static 2021-11-15 16:00:54 -05:00
setfiles setfiles/restorecon: support parallel relabeling 2021-11-23 10:03:18 +01:00
setsebool setsebool: report errors from commit phase 2020-04-28 09:26:26 +02:00
.gitignore Move policycoreutils/semodule_package to semodule-utils. 2016-11-16 11:19:51 -05:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile Move policycoreutils/semodule_package to semodule-utils. 2016-11-16 11:19:51 -05:00
VERSION Update VERSIONs to 3.3 for release. 2021-10-21 16:31:23 +02:00