Skip to content

Commit 96cabcf

Browse files
author
Herton R. Krzesinski
committed
redhat/kernel.spec.template: Parallelize compression
Bugzilla: INTERNAL Upstream Status: RHEL only commit 7f5f91411c41096fff0b86718584363dd910cd6b Author: Prarit Bhargava <prarit@redhat.com> Date: Sat Jan 21 07:54:21 2023 -0500 redhat/kernel.spec.template: Parallelize compression This line in the kernel.spec file: find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P${RPM_BUILD_NCPUS} -r xz; implies that ${RPM_BUILD_NCPUS} xz instances are run. This is not true, and this line actually applies ${RPM_BUILD_NCPUS} to a single instance of xz. This means that the compression has been done one module at a time (ie, in serial) rather than in parallel as is implied by the code. Use xarg's -n option to assign 16 cpus per process and parallelize the compression. Suggested-by: "Herton R. Krzesinski" <herton@redhat.com> Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
1 parent 63b65fc commit 96cabcf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

redhat/kernel.spec.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,8 @@ find Documentation -type d | xargs chmod u+w
25942594
fi \
25952595
fi \
25962596
if [ "%{zipmodules}" -eq "1" ]; then \
2597-
find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P${RPM_BUILD_NCPUS} -r xz; \
2597+
echo "Compressing kernel modules ..." \
2598+
find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -n 16 -P${RPM_BUILD_NCPUS} -r xz; \
25982599
fi \
25992600
%{nil}
26002601

0 commit comments

Comments
 (0)