Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3372945rwb; Fri, 30 Sep 2022 02:35:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6C3bZOyOmb50oVEGAcJuedkGzVm2Mt4+wtqMEbFLmTLByvCqsoCFOr1WzcJzRX2GBqYLmL X-Received: by 2002:a63:8848:0:b0:440:6360:8f44 with SMTP id l69-20020a638848000000b0044063608f44mr4492659pgd.262.1664530553155; Fri, 30 Sep 2022 02:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664530553; cv=none; d=google.com; s=arc-20160816; b=PuzScQ+8ciNodXy0kS67WO/mcNRAvvQNgICB5jvduptPfNoYRRot4tNHF69eEhuiNV iZiCubsZ5wxp9zDYlDEc6uq3Bcx1tuhNmuy+PTnJgNQfsP4KPgVTlRDLltCBZ+Dj5v3t Aiz7lQNrg1ZkU+goH47bLCuHBdJvG1IaKsmIQEpKeQjU5GTecd575iIqqFspI+bj36nR p5ZZ80wXTnzGxtKZgCsdYT/c5JTL+6a5PReqYQEvTOTlP6PZhDB7T/h8pvPADhzAWmRy 1xxCRSQ7UlPHdEjsREpzVuWTHP3zziV2iukl5+CHoBd5P4FFoWYdzU6i6R29JstxGnCj Htow== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Ef5IuyOeO6z7ikns6ax4WLgPyIbqg9ElWreEHKCNBrA=; b=rjNou/T8V+zhUUHe1lddwMJuzi1QIYI6R/8jpDrGixchI5uEy7tw8+Xtkh/goSUlJ7 CX9KU85i1gZJyQt36uAzFOPlaSttDttagWNcZ3rWzpkppViyacEW6Blu3U3TuQTLcgVq O+rcChd/13WZxUbHFcbAP52VOSWzyariGqWLepRXO2iW0f3fpl9lEMaSILI/DP/nvKJ7 ORcNt263BUJbc98Ez0PRX6vpfnIEG/xDPwzB/WxushMgWI5EdAj26gTN+BwaJWTxIN24 cah7Ot3m6frm5W2lytSVSAp7kQYPQzdUvFC3pzs4yu7ExUtvLR1h8tJMWP4dfURS5YZ7 TFyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g64-20020a636b43000000b0041da571906fsi1327997pgc.121.2022.09.30.02.35.42; Fri, 30 Sep 2022 02:35:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbiI3JOT (ORCPT + 99 others); Fri, 30 Sep 2022 05:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231376AbiI3JON (ORCPT ); Fri, 30 Sep 2022 05:14:13 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5725C12F772 for ; Fri, 30 Sep 2022 02:14:12 -0700 (PDT) Received: from canpemm500006.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Mf4DK3YcrzHtsT; Fri, 30 Sep 2022 17:09:21 +0800 (CST) Received: from use12-sp2.huawei.com (10.67.189.174) by canpemm500006.china.huawei.com (7.192.105.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 17:14:10 +0800 From: Xiaoming Ni To: , CC: , , , , Subject: [PATCH v5 0/2] squashfs: Add the mount parameter "threads=" Date: Fri, 30 Sep 2022 17:14:04 +0800 Message-ID: <20220930091406.50869-1-nixiaoming@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220916083604.33408-1-nixiaoming@huawei.com> References: <20220916083604.33408-1-nixiaoming@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.189.174] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500006.china.huawei.com (7.192.105.130) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, Squashfs supports multiple decompressor parallel modes. However, this mode can be configured only during kernel building and does not support flexible selection during runtime. In the current patch set, the mount parameter "threads=" is added to allow users to select the parallel decompressor mode and configure the number of decompressors when mounting a file system. "threads=" The upper limit is num_online_cpus() * 2. v5: fix a low-level mistake in patching: fs/squashfs/super.c:492:7: warning: "CONFIG_SQUASHFS_DECOMP_MULTI" is not defined, evaluates to 0 [-Wundef] v4: https://lore.kernel.org/lkml/20220916083604.33408-1-nixiaoming@huawei.com/ Based on Philip Lougher's suggestion, make the following updates: 1. Use static modifiers to avoid changing symbol names. 2. Fixed some formatting issues v3: https://lore.kernel.org/lkml/20220902094855.22666-1-nixiaoming@huawei.com/ Based on Philip Lougher's suggestion, make the following updates: 1. The default configuration is the same as that before the patch installation. 2. Compile the three decompression modes when the new configuration is enabled. 3. "threads=1" supports only the SQUASHFS_DECOMP_SINGLE mode. v2: https://lore.kernel.org/lkml/20220816010052.15764-1-nixiaoming@huawei.com/ fix warning: sparse: incorrect type in initializer (different address spaces) Reported-by: kernel test robot v1: https://lore.kernel.org/lkml/20220815031100.75243-1-nixiaoming@huawei.com/ Xiaoming Ni (2): squashfs: add the mount parameter theads= squashfs: Allows users to configure the number of decompression threads fs/squashfs/Kconfig | 51 ++++++++++++++++-- fs/squashfs/block.c | 2 +- fs/squashfs/decompressor.c | 2 +- fs/squashfs/decompressor_multi.c | 20 ++++--- fs/squashfs/decompressor_multi_percpu.c | 23 +++++--- fs/squashfs/decompressor_single.c | 15 ++++-- fs/squashfs/squashfs.h | 23 ++++++-- fs/squashfs/squashfs_fs_sb.h | 4 +- fs/squashfs/super.c | 93 +++++++++++++++++++++++++++++++-- 9 files changed, 199 insertions(+), 34 deletions(-) -- 2.12.3