Message ID | 20231029161924.50648-1-amiculas@cisco.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp1761209vqb; Sun, 29 Oct 2023 09:21:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFrr9BnWP2Id0APtwQiHHT4Egwzxc9t4ciWf4AvoRCZshLFChIZWs1KI0Ey8BG/24NrCQV X-Received: by 2002:a05:6870:6c05:b0:1ef:c082:ecbe with SMTP id na5-20020a0568706c0500b001efc082ecbemr3868743oab.55.1698596478810; Sun, 29 Oct 2023 09:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698596478; cv=none; d=google.com; s=arc-20160816; b=y9IpMI36BNcYj8PYc45inDrm7FT5cnc5kHe40OAQRhZFdI2/uFADlYqKRKVpxAnd77 DODtURGIO4SMBuySnJnTmVAeYtT7brtPGnRITLo9L6v/kj8C4DVDsmDkoa06YtmvEDWD v/kTVGn13VgGVU075SfouoSqEf78LT11x00KpWC0VytrrouoU+gzITaRu3EN8CQVKvJ6 HKy7xXyc5Exx1NqsHcy2yDk+KjzZXCXuISLpz3famyuZI/cMeIWqTp4+9GNkRbceFdpx sqIq15qteai2Edxe2wDpB7fXeKiylpkRiQfgIRti6byvWy92JHhLIxL/x8haVspK/ia9 Bo5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JmQOayhcn7pqmN9ocTExlpcFC/h1uA6GaT3iEK11IF4=; fh=keEatAjqJ8JDfwyuW+GepWNF7G22gfkxxvvY1oYJ80k=; b=J9CxFZOQEt/f+go2HiFsDKq+QKuWg0nqYJALwI44W+vjeeOF1T0OJAQtsXTM52oP0X RuZF0InW4P/vKTnwO4+/0hbaPRYugFGJ7MR//eX5lmylgyLIvXb6yV6koWlywhU700u6 BwLva9+OkzoEwDsbWcderNyY6TNIGk0p3NceqDfAGflTN0SMX0SSCI/NDP9xC3w5CbMo DD6G45TuHdGjbSO/4/gh9uvPyutpl8mkKej5DisK7B6moexNQwrgx3ptxkuryJCbkXfQ 8gX6UVKrelaKSxYoHK4zNk/Rim4pJ1fO5tq8tvvfezmM+cMmUm13gQq2WyLwLeJWvbwX IRxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=dUQMGWml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z3-20020a056a00240300b006c0e3332528si1469818pfh.30.2023.10.29.09.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 09:21:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=dUQMGWml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 46DAD8096398; Sun, 29 Oct 2023 09:21:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjJ2QUs (ORCPT <rfc822;fengqi706@gmail.com> + 30 others); Sun, 29 Oct 2023 12:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjJ2QUr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 29 Oct 2023 12:20:47 -0400 Received: from aer-iport-7.cisco.com (aer-iport-7.cisco.com [173.38.203.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 212D2B6; Sun, 29 Oct 2023 09:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4679; q=dns/txt; s=iport; t=1698596443; x=1699806043; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=tnLPf2sXvL47AFGYLhJ5JeQR75s5yKHgRqPY7h3jlkw=; b=dUQMGWmlr6zJHnqK0ctf1p8UGN/QLNS0fKBpHFpKhSIR9BKAtgzpCzsx vqHwhrrV/j/o+cVoL7wvhT3zRFlYkTEX8MVeyeY4ihZBsUvY9uANhtAJ2 mLb6jzoNZhAK/M6o4kmBRsr3ziTZ4P/k4ICvSjstGoH4h7+oNsTgRAnJl E=; X-CSE-ConnectionGUID: ctT8cW7XT0Ol1SfrPHGlGg== X-CSE-MsgGUID: Rcnz4D2DR4inPJWVDkBJWg== X-IronPort-AV: E=Sophos;i="6.03,261,1694736000"; d="scan'208";a="10098900" Received: from aer-iport-nat.cisco.com (HELO aer-core-5.cisco.com) ([173.38.203.22]) by aer-iport-7.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2023 16:20:41 +0000 Received: from localhost ([10.61.205.52]) (authenticated bits=0) by aer-core-5.cisco.com (8.15.2/8.15.2) with ESMTPSA id 39TGKexk126456 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 29 Oct 2023 16:20:41 GMT From: Ariel Miculas <amiculas@cisco.com> To: linux-doc@vger.kernel.org Cc: serge@hallyn.com, Ariel Miculas <amiculas@cisco.com>, Phillip Lougher <phillip@squashfs.org.uk>, Jonathan Corbet <corbet@lwn.net>, linux-kernel@vger.kernel.org Subject: [PATCH v2] docs: filesystems: document the squashfs specific mount options Date: Sun, 29 Oct 2023 18:19:24 +0200 Message-ID: <20231029161924.50648-1-amiculas@cisco.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-User: amiculas@cisco.com X-Outbound-SMTP-Client: 10.61.205.52, [10.61.205.52] X-Outbound-Node: aer-core-5.cisco.com X-Spam-Status: No, score=-8.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 29 Oct 2023 09:21:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781107501319810967 X-GMAIL-MSGID: 1781107501319810967 |
Series |
[v2] docs: filesystems: document the squashfs specific mount options
|
|
Commit Message
Ariel Miculas
Oct. 29, 2023, 4:19 p.m. UTC
When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, the "threads" mount option
can be used to specify the decompression mode: single-threaded,
multi-threaded, percpu or the number of threads used for decompression.
When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set and
SQUASHFS_DECOMP_MULTI is set, the "threads" option can also be used to
specify the number of threads used for decompression. This mount option
is only mentioned in fs/squashfs/Kconfig, which makes it difficult to
find.
Another mount option available is "errors", which can be configured to
panic the kernel when squashfs errors are encountered.
Add both these options to the squashfs documentation, making them more
noticeable.
Signed-off-by: Ariel Miculas <amiculas@cisco.com>
---
Documentation/filesystems/squashfs.rst | 59 ++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
Comments
On 29/10/2023 16:19, Ariel Miculas wrote: > When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, the "threads" mount option > can be used to specify the decompression mode: single-threaded, > multi-threaded, percpu or the number of threads used for decompression. > When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set and > SQUASHFS_DECOMP_MULTI is set, the "threads" option can also be used to > specify the number of threads used for decompression. This mount option > is only mentioned in fs/squashfs/Kconfig, which makes it difficult to > find. > > Another mount option available is "errors", which can be configured to > panic the kernel when squashfs errors are encountered. > > Add both these options to the squashfs documentation, making them more > noticeable. > > Signed-off-by: Ariel Miculas <amiculas@cisco.com> Looks good to me. Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk> > --- > Documentation/filesystems/squashfs.rst | 59 ++++++++++++++++++++++++++ > 1 file changed, 59 insertions(+) > > diff --git a/Documentation/filesystems/squashfs.rst b/Documentation/filesystems/squashfs.rst > index df42106bae71..0a7fa66b70f8 100644 > --- a/Documentation/filesystems/squashfs.rst > +++ b/Documentation/filesystems/squashfs.rst > @@ -64,6 +64,65 @@ obtained from this site also. > The squashfs-tools development tree is now located on kernel.org > git://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git > > +2.1 Mount options > +----------------- > +=================== ========================================================= > +errors=%s Specify whether squashfs errors trigger a kernel panic > + or not > + > + ========== ============================================= > + continue errors don't trigger a panic (default) > + panic trigger a panic when errors are encountered, > + similar to several other filesystems (e.g. > + btrfs, ext4, f2fs, GFS2, jfs, ntfs, ubifs) > + > + This allows a kernel dump to be saved, > + useful for analyzing and debugging the > + corruption. > + ========== ============================================= > +threads=%s Select the decompression mode or the number of threads > + > + If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set: > + > + ========== ============================================= > + single use single-threaded decompression (default) > + > + Only one block (data or metadata) can be > + decompressed at any one time. This limits > + CPU and memory usage to a minimum, but it > + also gives poor performance on parallel I/O > + workloads when using multiple CPU machines > + due to waiting on decompressor availability. > + multi use up to two parallel decompressors per core > + > + If you have a parallel I/O workload and your > + system has enough memory, using this option > + may improve overall I/O performance. It > + dynamically allocates decompressors on a > + demand basis. > + percpu use a maximum of one decompressor per core > + > + It uses percpu variables to ensure > + decompression is load-balanced across the > + cores. > + 1|2|3|... configure the number of threads used for > + decompression > + > + The upper limit is num_online_cpus() * 2. > + ========== ============================================= > + > + If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and > + SQUASHFS_DECOMP_MULTI is set: > + > + ========== ============================================= > + 2|3|... configure the number of threads used for > + decompression > + > + The upper limit is num_online_cpus() * 2. > + ========== ============================================= > + > +=================== ========================================================= > + > 3. Squashfs Filesystem Design > ----------------------------- >
On Sun, Oct 29, 2023 at 06:19:24PM +0200, Ariel Miculas wrote: > +2.1 Mount options > +----------------- > +=================== ========================================================= > +errors=%s Specify whether squashfs errors trigger a kernel panic > + or not > + > + ========== ============================================= > + continue errors don't trigger a panic (default) > + panic trigger a panic when errors are encountered, > + similar to several other filesystems (e.g. > + btrfs, ext4, f2fs, GFS2, jfs, ntfs, ubifs) > + > + This allows a kernel dump to be saved, > + useful for analyzing and debugging the > + corruption. > + ========== ============================================= > +threads=%s Select the decompression mode or the number of threads > + > + If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set: > + > + ========== ============================================= > + single use single-threaded decompression (default) > + > + Only one block (data or metadata) can be > + decompressed at any one time. This limits > + CPU and memory usage to a minimum, but it > + also gives poor performance on parallel I/O > + workloads when using multiple CPU machines > + due to waiting on decompressor availability. > + multi use up to two parallel decompressors per core > + > + If you have a parallel I/O workload and your > + system has enough memory, using this option > + may improve overall I/O performance. It > + dynamically allocates decompressors on a > + demand basis. > + percpu use a maximum of one decompressor per core > + > + It uses percpu variables to ensure > + decompression is load-balanced across the > + cores. > + 1|2|3|... configure the number of threads used for > + decompression > + > + The upper limit is num_online_cpus() * 2. > + ========== ============================================= > + > + If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and > + SQUASHFS_DECOMP_MULTI is set: > + > + ========== ============================================= > + 2|3|... configure the number of threads used for > + decompression > + > + The upper limit is num_online_cpus() * 2. > + ========== ============================================= > + > +=================== ========================================================= > + > The doc LGTM, thanks! Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
On 23/10/29 08:33PM, Phillip Lougher wrote: > On 29/10/2023 16:19, Ariel Miculas wrote: > > When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, the "threads" mount option > > can be used to specify the decompression mode: single-threaded, > > multi-threaded, percpu or the number of threads used for decompression. > > When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set and > > SQUASHFS_DECOMP_MULTI is set, the "threads" option can also be used to > > specify the number of threads used for decompression. This mount option > > is only mentioned in fs/squashfs/Kconfig, which makes it difficult to > > find. > > > > Another mount option available is "errors", which can be configured to > > panic the kernel when squashfs errors are encountered. > > > > Add both these options to the squashfs documentation, making them more > > noticeable. > > > > Signed-off-by: Ariel Miculas <amiculas@cisco.com> > > Looks good to me. > > Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk> Unfortunately, it seems this is not quite correct either: There is the config option SQUASHFS_MOUNT_DECOMP_THREADS: ``` bool "Add the mount parameter 'threads=' for squashfs" depends on SQUASHFS depends on SQUASHFS_DECOMP_MULTI default n help Use threads= to set the decompression parallel mode and the number of threads. If SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y threads=<single|multi|percpu|1|2|3|...> else threads=<2|3|...> The upper limit is num_online_cpus() * 2. ``` that depends on SQUASHFS_DECOMP_MULTI. So I think I should take my v1 patch and specify that the "threads=" mount option depends on SQUASHFS_MOUNT_DECOMP_THREADS. There's no need to specify SQUASHFS_DECOMP_MULTI, because SQUASHFS_MOUNT_DECOMP_THREADS already depends on it. What do you think? Regards, Ariel
On 30/10/2023 12:57, Ariel Miculas wrote: > On 23/10/29 08:33PM, Phillip Lougher wrote: >> On 29/10/2023 16:19, Ariel Miculas wrote: >>> When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, the "threads" mount option >>> can be used to specify the decompression mode: single-threaded, >>> multi-threaded, percpu or the number of threads used for decompression. >>> When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set and >>> SQUASHFS_DECOMP_MULTI is set, the "threads" option can also be used to >>> specify the number of threads used for decompression. This mount option >>> is only mentioned in fs/squashfs/Kconfig, which makes it difficult to >>> find. >>> >>> Another mount option available is "errors", which can be configured to >>> panic the kernel when squashfs errors are encountered. >>> >>> Add both these options to the squashfs documentation, making them more >>> noticeable. >>> >>> Signed-off-by: Ariel Miculas <amiculas@cisco.com> >> >> Looks good to me. >> >> Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk> > > Unfortunately, it seems this is not quite correct either: > There is the config option SQUASHFS_MOUNT_DECOMP_THREADS: > ``` > bool "Add the mount parameter 'threads=' for squashfs" > depends on SQUASHFS > depends on SQUASHFS_DECOMP_MULTI > default n > help > Use threads= to set the decompression parallel mode and the number of threads. > If SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y > threads=<single|multi|percpu|1|2|3|...> > else > threads=<2|3|...> > The upper limit is num_online_cpus() * 2. > ``` > that depends on SQUASHFS_DECOMP_MULTI. > So I think I should take my v1 patch and specify that the "threads=" > mount option depends on SQUASHFS_MOUNT_DECOMP_THREADS. There's no need > to specify SQUASHFS_DECOMP_MULTI, because SQUASHFS_MOUNT_DECOMP_THREADS > already depends on it. Sorry, you have to specify SQUASHFS_DECOMP_MULTI to be able to specify SQUASHFS_MOUNT_DECOMP_THREADS if SQUASHFS_DECOMP_BY_MOUNT is unselected. Just try it, do make menuconfig, ensure SQUASHFS_CHOICE_DECOMP_BY_MOUNT is unselected, select Single threaded decompression and you won't be able to specify SQUASHFS_MOUNT_DECOMP_THREADS. That was the point of my review. What bit don't you understand? Phillip > What do you think? > > Regards, > Ariel >
On 23/10/30 03:40PM, Phillip Lougher wrote: > On 30/10/2023 12:57, Ariel Miculas wrote: > > On 23/10/29 08:33PM, Phillip Lougher wrote: > > > On 29/10/2023 16:19, Ariel Miculas wrote: > > > > When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, the "threads" mount option > > > > can be used to specify the decompression mode: single-threaded, > > > > multi-threaded, percpu or the number of threads used for decompression. > > > > When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set and > > > > SQUASHFS_DECOMP_MULTI is set, the "threads" option can also be used to > > > > specify the number of threads used for decompression. This mount option > > > > is only mentioned in fs/squashfs/Kconfig, which makes it difficult to > > > > find. > > > > > > > > Another mount option available is "errors", which can be configured to > > > > panic the kernel when squashfs errors are encountered. > > > > > > > > Add both these options to the squashfs documentation, making them more > > > > noticeable. > > > > > > > > Signed-off-by: Ariel Miculas <amiculas@cisco.com> > > > > > > Looks good to me. > > > > > > Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk> > > > > Unfortunately, it seems this is not quite correct either: > > There is the config option SQUASHFS_MOUNT_DECOMP_THREADS: > > ``` > > bool "Add the mount parameter 'threads=' for squashfs" > > depends on SQUASHFS > > depends on SQUASHFS_DECOMP_MULTI > > default n > > help > > Use threads= to set the decompression parallel mode and the number of threads. > > If SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y > > threads=<single|multi|percpu|1|2|3|...> > > else > > threads=<2|3|...> > > The upper limit is num_online_cpus() * 2. > > ``` > > that depends on SQUASHFS_DECOMP_MULTI. > > So I think I should take my v1 patch and specify that the "threads=" > > mount option depends on SQUASHFS_MOUNT_DECOMP_THREADS. There's no need > > to specify SQUASHFS_DECOMP_MULTI, because SQUASHFS_MOUNT_DECOMP_THREADS > > already depends on it. > > Sorry, you have to specify SQUASHFS_DECOMP_MULTI to be able to specify > SQUASHFS_MOUNT_DECOMP_THREADS if SQUASHFS_DECOMP_BY_MOUNT is unselected. Agree. > > Just try it, do make menuconfig, ensure SQUASHFS_CHOICE_DECOMP_BY_MOUNT > is unselected, select Single threaded decompression and you won't be > able to specify SQUASHFS_MOUNT_DECOMP_THREADS. True. > > That was the point of my review. What bit don't you understand? But SQUASHFS_DECOMP_MULTI is not enough, you need to specify SQUASHFS_MOUNT_DECOMP_THREADS in order to use the "threads=" mount option. So instead of saying ``` If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and SQUASHFS_DECOMP_MULTI is set: ``` wouldn't it be right to actually say: ``` If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and SQUASHFS_MOUNT_DECOMP_THREADS is set: ```? As you've mentioned, you could only set SQUASHFS_MOUNT_DECOMP_THREADS when SQUASHFS_DECOMP_MULTI is selected. That happens in two cases: * either SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, in which case it also selects SQUASHFS_MOUNT_DECOMP_THREADS * either SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set, SQUASHFS_DECOMP_MULTI is set and SQUASHFS_MOUNT_DECOMP_THREADS is also set So I wouldn't even mention SQUASHFS_DECOMP_MULTI in the documentation, only SQUASHFS_MOUNT_DECOMP_THREADS, because the latter always depends on the former. And the "threads=" mount option is only available when SQUASHFS_MOUNT_DECOMP_THREADS is set (which is the configuration I've missed in v1 and v2). Regards, Ariel > > Phillip > > > What do you think? > > > > Regards, > > Ariel > > >
On 30/10/2023 16:09, Ariel Miculas wrote: > On 23/10/30 03:40PM, Phillip Lougher wrote: >> On 30/10/2023 12:57, Ariel Miculas wrote: >>> On 23/10/29 08:33PM, Phillip Lougher wrote: >>>> On 29/10/2023 16:19, Ariel Miculas wrote: >>>>> When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, the "threads" mount option >>>>> can be used to specify the decompression mode: single-threaded, >>>>> multi-threaded, percpu or the number of threads used for decompression. >>>>> When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set and >>>>> SQUASHFS_DECOMP_MULTI is set, the "threads" option can also be used to >>>>> specify the number of threads used for decompression. This mount option >>>>> is only mentioned in fs/squashfs/Kconfig, which makes it difficult to >>>>> find. >>>>> >>>>> Another mount option available is "errors", which can be configured to >>>>> panic the kernel when squashfs errors are encountered. >>>>> >>>>> Add both these options to the squashfs documentation, making them more >>>>> noticeable. >>>>> >>>>> Signed-off-by: Ariel Miculas <amiculas@cisco.com> >>>> >>>> Looks good to me. >>>> >>>> Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk> >>> >>> Unfortunately, it seems this is not quite correct either: >>> There is the config option SQUASHFS_MOUNT_DECOMP_THREADS: >>> ``` >>> bool "Add the mount parameter 'threads=' for squashfs" >>> depends on SQUASHFS >>> depends on SQUASHFS_DECOMP_MULTI >>> default n >>> help >>> Use threads= to set the decompression parallel mode and the number of threads. >>> If SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y >>> threads=<single|multi|percpu|1|2|3|...> >>> else >>> threads=<2|3|...> >>> The upper limit is num_online_cpus() * 2. >>> ``` >>> that depends on SQUASHFS_DECOMP_MULTI. >>> So I think I should take my v1 patch and specify that the "threads=" >>> mount option depends on SQUASHFS_MOUNT_DECOMP_THREADS. There's no need >>> to specify SQUASHFS_DECOMP_MULTI, because SQUASHFS_MOUNT_DECOMP_THREADS >>> already depends on it. >> >> Sorry, you have to specify SQUASHFS_DECOMP_MULTI to be able to specify >> SQUASHFS_MOUNT_DECOMP_THREADS if SQUASHFS_DECOMP_BY_MOUNT is unselected. > Agree. >> >> Just try it, do make menuconfig, ensure SQUASHFS_CHOICE_DECOMP_BY_MOUNT >> is unselected, select Single threaded decompression and you won't be >> able to specify SQUASHFS_MOUNT_DECOMP_THREADS. > True. >> >> That was the point of my review. What bit don't you understand? > But SQUASHFS_DECOMP_MULTI is not enough, you need to specify > SQUASHFS_MOUNT_DECOMP_THREADS in order to use the "threads=" mount > option. > So instead of saying > ``` > If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and > SQUASHFS_DECOMP_MULTI is set: > ``` > wouldn't it be right to actually say: > ``` > If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and > SQUASHFS_MOUNT_DECOMP_THREADS is set: > ```? > > As you've mentioned, you could only set SQUASHFS_MOUNT_DECOMP_THREADS > when SQUASHFS_DECOMP_MULTI is selected. That happens in two cases: > * either SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, in which case it also > selects SQUASHFS_MOUNT_DECOMP_THREADS > * either SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set, > SQUASHFS_DECOMP_MULTI is set and SQUASHFS_MOUNT_DECOMP_THREADS is also > set > > So I wouldn't even mention SQUASHFS_DECOMP_MULTI in the documentation, > only SQUASHFS_MOUNT_DECOMP_THREADS, because the latter always depends on > the former. And the "threads=" mount option is only available when > SQUASHFS_MOUNT_DECOMP_THREADS is set (which is the configuration I've > missed in v1 and v2). > You seem determined to create an unpleasant argument here by trying to argue your first patch was correct, and I, as merely the maintainer, can't tell you to change it to how I want it. If, as you pointed out in your first patch, the purpose is to document the mount options, then the fact that threads=xxx option depends on SQUASHFS_DECOMP_MULTI being selected is important, and should be mentioned. I have accepted your V2. If you want to withdraw it now, please do so. But I will not accept further patches from you, nor respond to any more of your emails. It is never a good look to argue with the maintainer, when I am trying to help you make your patch better. You attitude means this has been a waste of my time so far. Phillip > Regards, > Ariel >> >> Phillip >> >>> What do you think? >>> >>> Regards, >>> Ariel >>> >>
On 23/10/30 04:28PM, Phillip Lougher wrote: > On 30/10/2023 16:09, Ariel Miculas wrote: > > On 23/10/30 03:40PM, Phillip Lougher wrote: > > > On 30/10/2023 12:57, Ariel Miculas wrote: > > > > On 23/10/29 08:33PM, Phillip Lougher wrote: > > > > > On 29/10/2023 16:19, Ariel Miculas wrote: > > > > > > When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, the "threads" mount option > > > > > > can be used to specify the decompression mode: single-threaded, > > > > > > multi-threaded, percpu or the number of threads used for decompression. > > > > > > When SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set and > > > > > > SQUASHFS_DECOMP_MULTI is set, the "threads" option can also be used to > > > > > > specify the number of threads used for decompression. This mount option > > > > > > is only mentioned in fs/squashfs/Kconfig, which makes it difficult to > > > > > > find. > > > > > > > > > > > > Another mount option available is "errors", which can be configured to > > > > > > panic the kernel when squashfs errors are encountered. > > > > > > > > > > > > Add both these options to the squashfs documentation, making them more > > > > > > noticeable. > > > > > > > > > > > > Signed-off-by: Ariel Miculas <amiculas@cisco.com> > > > > > > > > > > Looks good to me. > > > > > > > > > > Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk> > > > > > > > > Unfortunately, it seems this is not quite correct either: > > > > There is the config option SQUASHFS_MOUNT_DECOMP_THREADS: > > > > ``` > > > > bool "Add the mount parameter 'threads=' for squashfs" > > > > depends on SQUASHFS > > > > depends on SQUASHFS_DECOMP_MULTI > > > > default n > > > > help > > > > Use threads= to set the decompression parallel mode and the number of threads. > > > > If SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y > > > > threads=<single|multi|percpu|1|2|3|...> > > > > else > > > > threads=<2|3|...> > > > > The upper limit is num_online_cpus() * 2. > > > > ``` > > > > that depends on SQUASHFS_DECOMP_MULTI. > > > > So I think I should take my v1 patch and specify that the "threads=" > > > > mount option depends on SQUASHFS_MOUNT_DECOMP_THREADS. There's no need > > > > to specify SQUASHFS_DECOMP_MULTI, because SQUASHFS_MOUNT_DECOMP_THREADS > > > > already depends on it. > > > > > > Sorry, you have to specify SQUASHFS_DECOMP_MULTI to be able to specify > > > SQUASHFS_MOUNT_DECOMP_THREADS if SQUASHFS_DECOMP_BY_MOUNT is unselected. > > Agree. > > > > > > Just try it, do make menuconfig, ensure SQUASHFS_CHOICE_DECOMP_BY_MOUNT > > > is unselected, select Single threaded decompression and you won't be > > > able to specify SQUASHFS_MOUNT_DECOMP_THREADS. > > True. > > > > > > That was the point of my review. What bit don't you understand? > > But SQUASHFS_DECOMP_MULTI is not enough, you need to specify > > SQUASHFS_MOUNT_DECOMP_THREADS in order to use the "threads=" mount > > option. > > So instead of saying > > ``` > > If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and > > SQUASHFS_DECOMP_MULTI is set: > > ``` > > wouldn't it be right to actually say: > > ``` > > If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and > > SQUASHFS_MOUNT_DECOMP_THREADS is set: > > ```? > > > > As you've mentioned, you could only set SQUASHFS_MOUNT_DECOMP_THREADS > > when SQUASHFS_DECOMP_MULTI is selected. That happens in two cases: > > * either SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set, in which case it also > > selects SQUASHFS_MOUNT_DECOMP_THREADS > > * either SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set, > > SQUASHFS_DECOMP_MULTI is set and SQUASHFS_MOUNT_DECOMP_THREADS is also > > set > > > > So I wouldn't even mention SQUASHFS_DECOMP_MULTI in the documentation, > > only SQUASHFS_MOUNT_DECOMP_THREADS, because the latter always depends on > > the former. And the "threads=" mount option is only available when > > SQUASHFS_MOUNT_DECOMP_THREADS is set (which is the configuration I've > > missed in v1 and v2). > > > > You seem determined to create an unpleasant argument here by trying to argue > your first patch was correct, and I, as merely the maintainer, can't tell > you to change it to how I want it. I'm not trying to argue that my first patch is correct, I'm sorry if it seems this way. I'm trying to argue that my v2 patch is also missing the mention of SQUASHFS_MOUNT_DECOMP_THREADS. > > If, as you pointed out in your first patch, the purpose is to > document the mount options, then the fact that threads=xxx > option depends on SQUASHFS_DECOMP_MULTI being selected is > important, and should be mentioned. Ok, I understand this. I also think it's important to mention SQUASHFS_MOUNT_DECOMP_THREADS, which was an oversight from my part. > > I have accepted your V2. If you want to withdraw it now, please > do so. But I will not accept further patches from you, nor > respond to any more of your emails. > > It is never a good look to argue with the maintainer, when I am > trying to help you make your patch better. You attitude means this > has been a waste of my time so far. I didn't want to argue against your suggestion, I did appreciate it and I have sent a v2 patch implementing it. I only wanted to point out a missing configuration option that, in my opinion, should also be part of the documentation. If you think that's not the case, let me know. Regards, Ariel > > Phillip > > > Regards, > > Ariel > > > > > > Phillip > > > > > > > What do you think? > > > > > > > > Regards, > > > > Ariel > > > > > > > >
diff --git a/Documentation/filesystems/squashfs.rst b/Documentation/filesystems/squashfs.rst index df42106bae71..0a7fa66b70f8 100644 --- a/Documentation/filesystems/squashfs.rst +++ b/Documentation/filesystems/squashfs.rst @@ -64,6 +64,65 @@ obtained from this site also. The squashfs-tools development tree is now located on kernel.org git://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git +2.1 Mount options +----------------- +=================== ========================================================= +errors=%s Specify whether squashfs errors trigger a kernel panic + or not + + ========== ============================================= + continue errors don't trigger a panic (default) + panic trigger a panic when errors are encountered, + similar to several other filesystems (e.g. + btrfs, ext4, f2fs, GFS2, jfs, ntfs, ubifs) + + This allows a kernel dump to be saved, + useful for analyzing and debugging the + corruption. + ========== ============================================= +threads=%s Select the decompression mode or the number of threads + + If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is set: + + ========== ============================================= + single use single-threaded decompression (default) + + Only one block (data or metadata) can be + decompressed at any one time. This limits + CPU and memory usage to a minimum, but it + also gives poor performance on parallel I/O + workloads when using multiple CPU machines + due to waiting on decompressor availability. + multi use up to two parallel decompressors per core + + If you have a parallel I/O workload and your + system has enough memory, using this option + may improve overall I/O performance. It + dynamically allocates decompressors on a + demand basis. + percpu use a maximum of one decompressor per core + + It uses percpu variables to ensure + decompression is load-balanced across the + cores. + 1|2|3|... configure the number of threads used for + decompression + + The upper limit is num_online_cpus() * 2. + ========== ============================================= + + If SQUASHFS_CHOICE_DECOMP_BY_MOUNT is **not** set and + SQUASHFS_DECOMP_MULTI is set: + + ========== ============================================= + 2|3|... configure the number of threads used for + decompression + + The upper limit is num_online_cpus() * 2. + ========== ============================================= + +=================== ========================================================= + 3. Squashfs Filesystem Design -----------------------------