Skip to content

Commit

Permalink
image: let mksquashfs4 use all processors
Browse files Browse the repository at this point in the history
Drop the -processors argument from the mksquashfs4 call, so it will use
all available processors. This dramatically reduces the time to create
squashfs filesystems.

The times below are observed when building an image for my main router,
the WatchGuard Firebox M300 (qoriq target):

Before:
real    4m45,973s

After:
real    0m23,497s

With this commit `mksquashfs` may use more cores than defined via `-j`.
This is the same behaviour as for archive creation of ImageBuilder, SDK
or toolchain. There is no trivial way to limit `mksquashfs` CPU core
usage to the amount of "free" make jobs since two running `mksquashfs`
instances would each run with the total allowed number (-j) of threads.

Signed-off-by: Stijn Tintel <[email protected]>
[extended reasoning in commit message]
Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
stintel authored and aparcar committed Mar 29, 2022
1 parent 34fb36e commit df2ae88
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ $(eval $(foreach S,$(NAND_BLOCKSIZE),$(call Image/mkfs/jffs2-nand/template,$(S))
define Image/mkfs/squashfs-common
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
-nopad -noappend -root-owned \
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
-processors 1
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT)
endef

ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y)
Expand Down

0 comments on commit df2ae88

Please sign in to comment.