From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 14 Aug 2024 12:07:59 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1seAv9-009VAm-06 for lore@lore.pengutronix.de; Wed, 14 Aug 2024 12:07:59 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1seAv8-0003Ox-4a; Wed, 14 Aug 2024 12:07:58 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1seAv4-0003OW-R6; Wed, 14 Aug 2024 12:07:54 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seAv4-000Kjl-EC; Wed, 14 Aug 2024 12:07:54 +0200 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1seAv4-003CKq-1G; Wed, 14 Aug 2024 12:07:54 +0200 From: Roland Hieber To: distrokit@pengutronix.de Date: Wed, 14 Aug 2024 12:07:50 +0200 Message-Id: <20240814100750.751398-1-rhi@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH] platforms: kernel: optimise squashfs decompression X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roland Hieber Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false * Decompress directly into the page cache instead of an intermediate buffer, which eliminates a memcpy and it also removes the lock contention on the single buffer. * Enable threaded decompression where possible. SQUASHFS_COMPILE_DECOMP_MULTI uses up to two decompressors per core and the help text suggests that this is the better option for parallel I/O workloads and enough system memory. This is usually not the case on our boards, so switch to SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU instead, which uses up to one decompressor thread per core and ensures decompression is load-balanced across the cores. [Changes recommended by PTX QA tooling] Signed-off-by: Roland Hieber --- configs/platform-mips/kernelconfig | 10 +++++----- configs/platform-mips/kernelconfig-ar9331 | 10 +++++----- configs/platform-mips/kernelconfig-ar9331.diff | 2 +- configs/platform-mips/kernelconfig-malta.diff | 4 ++-- configs/platform-mipsel/kernelconfig | 10 +++++----- configs/platform-mipsel/kernelconfig-malta.diff | 4 ++-- configs/platform-rpi1/kernelconfig | 10 +++++----- configs/platform-v7a/kernelconfig | 7 +++---- configs/platform-v7a_noneon/kernelconfig | 10 +++++----- configs/platform-x86_64/kernelconfig | 10 +++++----- 10 files changed, 38 insertions(+), 39 deletions(-) diff --git a/configs/platform-mips/kernelconfig b/configs/platform-mips/kernelconfig index 98f3196ef1ef..24f9a8f8235c 100644 --- a/configs/platform-mips/kernelconfig +++ b/configs/platform-mips/kernelconfig @@ -2631,13 +2631,13 @@ CONFIG_UBIFS_FS_SECURITY=y # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_CRAMFS is not set CONFIG_SQUASHFS=y -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_FILE_CACHE is not set +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_XATTR is not set CONFIG_SQUASHFS_ZLIB=y # CONFIG_SQUASHFS_LZ4 is not set diff --git a/configs/platform-mips/kernelconfig-ar9331 b/configs/platform-mips/kernelconfig-ar9331 index e83cd18131fc..6e951a614ad8 100644 --- a/configs/platform-mips/kernelconfig-ar9331 +++ b/configs/platform-mips/kernelconfig-ar9331 @@ -2620,13 +2620,13 @@ CONFIG_UBIFS_FS_SECURITY=y # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_CRAMFS is not set CONFIG_SQUASHFS=y -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_FILE_CACHE is not set +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_XATTR is not set CONFIG_SQUASHFS_ZLIB=y # CONFIG_SQUASHFS_LZ4 is not set diff --git a/configs/platform-mips/kernelconfig-ar9331.diff b/configs/platform-mips/kernelconfig-ar9331.diff index 727497c2a06c..12a0224e9844 100644 --- a/configs/platform-mips/kernelconfig-ar9331.diff +++ b/configs/platform-mips/kernelconfig-ar9331.diff @@ -1,4 +1,4 @@ -af97ac2360293c1315a7accdcaa0b01e +ea4829d5ac8a0aa3ee33fc132702ae88 # CONFIG_ACORN_PARTITION is undefined # CONFIG_AIX_PARTITION is undefined # CONFIG_AMIGA_PARTITION is undefined diff --git a/configs/platform-mips/kernelconfig-malta.diff b/configs/platform-mips/kernelconfig-malta.diff index ce4b18d27390..679bf6255ed6 100644 --- a/configs/platform-mips/kernelconfig-malta.diff +++ b/configs/platform-mips/kernelconfig-malta.diff @@ -1,4 +1,4 @@ -af97ac2360293c1315a7accdcaa0b01e +ea4829d5ac8a0aa3ee33fc132702ae88 # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_ACENIC is not set @@ -1627,7 +1627,7 @@ CONFIG_SOCK_RX_QUEUE_MAPPING=y # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is undefined # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is undefined # CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is undefined -# CONFIG_SQUASHFS_DECOMP_SINGLE is undefined +# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is undefined # CONFIG_SQUASHFS_EMBEDDED is undefined # CONFIG_SQUASHFS_FILE_CACHE is undefined # CONFIG_SQUASHFS_FILE_DIRECT is undefined diff --git a/configs/platform-mipsel/kernelconfig b/configs/platform-mipsel/kernelconfig index 117c56cca057..1f9edd76de9b 100644 --- a/configs/platform-mipsel/kernelconfig +++ b/configs/platform-mipsel/kernelconfig @@ -2681,13 +2681,13 @@ CONFIG_UBIFS_FS_SECURITY=y # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_CRAMFS is not set CONFIG_SQUASHFS=y -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_FILE_CACHE is not set +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_XATTR is not set CONFIG_SQUASHFS_ZLIB=y # CONFIG_SQUASHFS_LZ4 is not set diff --git a/configs/platform-mipsel/kernelconfig-malta.diff b/configs/platform-mipsel/kernelconfig-malta.diff index 15b80d0fafd8..a8ee88c1017c 100644 --- a/configs/platform-mipsel/kernelconfig-malta.diff +++ b/configs/platform-mipsel/kernelconfig-malta.diff @@ -1,4 +1,4 @@ -9b8cb4d1395ae94191677a625040e2fa +17fe512614955c6a3a288ec4e2d08bc8 # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_ACENIC is not set @@ -1535,7 +1535,7 @@ CONFIG_SMSC_PHY=m # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is undefined # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is undefined # CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is undefined -# CONFIG_SQUASHFS_DECOMP_SINGLE is undefined +# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is undefined # CONFIG_SQUASHFS_EMBEDDED is undefined # CONFIG_SQUASHFS_FILE_CACHE is undefined # CONFIG_SQUASHFS_FILE_DIRECT is undefined diff --git a/configs/platform-rpi1/kernelconfig b/configs/platform-rpi1/kernelconfig index 29ea46525108..00795f8b3074 100644 --- a/configs/platform-rpi1/kernelconfig +++ b/configs/platform-rpi1/kernelconfig @@ -3454,13 +3454,13 @@ CONFIG_UBIFS_FS_SECURITY=y # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_CRAMFS is not set CONFIG_SQUASHFS=y -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_FILE_CACHE is not set +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_XATTR is not set CONFIG_SQUASHFS_ZLIB=y # CONFIG_SQUASHFS_LZ4 is not set diff --git a/configs/platform-v7a/kernelconfig b/configs/platform-v7a/kernelconfig index 5f12b549580c..f59ceb5a4bdd 100644 --- a/configs/platform-v7a/kernelconfig +++ b/configs/platform-v7a/kernelconfig @@ -3737,12 +3737,11 @@ CONFIG_UBIFS_FS_XATTR=y CONFIG_SQUASHFS=y # CONFIG_SQUASHFS_FILE_CACHE is not set CONFIG_SQUASHFS_FILE_DIRECT=y -CONFIG_SQUASHFS_DECOMP_MULTI=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set # CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI=y -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set -# CONFIG_SQUASHFS_MOUNT_DECOMP_THREADS is not set +# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_XATTR is not set CONFIG_SQUASHFS_ZLIB=y CONFIG_SQUASHFS_LZ4=y diff --git a/configs/platform-v7a_noneon/kernelconfig b/configs/platform-v7a_noneon/kernelconfig index 0600fcb1c2cd..3cb360535d23 100644 --- a/configs/platform-v7a_noneon/kernelconfig +++ b/configs/platform-v7a_noneon/kernelconfig @@ -3343,13 +3343,13 @@ CONFIG_UBIFS_FS_SECURITY=y # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_CRAMFS is not set CONFIG_SQUASHFS=y -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_FILE_CACHE is not set +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_XATTR is not set CONFIG_SQUASHFS_ZLIB=y # CONFIG_SQUASHFS_LZ4 is not set diff --git a/configs/platform-x86_64/kernelconfig b/configs/platform-x86_64/kernelconfig index 6ad5ef703289..22a8433f7cea 100644 --- a/configs/platform-x86_64/kernelconfig +++ b/configs/platform-x86_64/kernelconfig @@ -3515,13 +3515,13 @@ CONFIG_UBIFS_FS_SECURITY=y # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_CRAMFS is not set CONFIG_SQUASHFS=y -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_FILE_CACHE is not set +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y # CONFIG_SQUASHFS_XATTR is not set CONFIG_SQUASHFS_ZLIB=y # CONFIG_SQUASHFS_LZ4 is not set -- 2.39.2