Re: [PATCH v1 2/3] policycoreutils/setfiles: use all CPU cores by default

Stephen Smalley <[email protected]>
Newsgroups org.kernel.vger.selinux
Message-ID <CAEjxPJ7HWW3m4Gg5_32930-_XZtgUJXDGQNEvCvT9hbqfNDAEg@mail.gmail.com>
On Tue, Aug 18, 2026 at 3:24 PM jboero <[email protected]> wrote:
>
> From: Johnny Boero <[email protected]>
>
> setfiles(8) and restorecon(8) have supported parallel relabeling via -T
> since commit 93902fc8b0b0 ("setfiles/restorecon: support parallel
> relabeling"), but default to a single thread, so anything that does not
> pass -T explicitly relabels on one core.
>
> That is most callers.  RPM scriptlets, fixfiles(8) and hand-run
> restorecon invocations all use the default, and on a machine with a high
> core count the result is a long, almost entirely idle relabel: a package
> upgrade on an 88 core system spent hours in restorecon with 87 cores
> doing nothing.
>
> Default nthreads to 0, i.e. one thread per available CPU core.  The
> relabeling is already serialized where it needs to be, and -T 1 remains
> available for callers that want the previous behaviour.
>
> Relabeling /usr/share (~588k files, dry run) on an 88 core system:
>
>   -T 1   20.43s
>   -T 0   15.78s
>
> Link: https://github.com/SELinuxProject/selinux/issues/489
> Signed-off-by: Johnny Boero <[email protected]>

Acked-by: Stephen Smalley <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.