Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1809071rwb; Tue, 27 Sep 2022 19:42:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ujbYMtY8Fn6Ff8uIb+tYvRTbHPCjomLEP14BZ4X0dGPHunV6pSEBVHI2SbmX5A0wQV1/n X-Received: by 2002:a17:90b:1b4f:b0:202:b066:322 with SMTP id nv15-20020a17090b1b4f00b00202b0660322mr7607564pjb.226.1664332945993; Tue, 27 Sep 2022 19:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664332945; cv=none; d=google.com; s=arc-20160816; b=LFcgk/t55yhKBtonpHAu42l0nI8+VVtn7fVHSW22ANyzItl0qGOZWkCfnNX1vjUuVf K9I4MZ+nArG8K9RGmIUtiYxqK3nic/7Vid2T7O4CW7cbgNCzCVHVXMxUHBsHeyJTFYDV aU6J3vSfiSCL6iyVIa5mtQjWl5FxhpB+tmAQPNd/u4GuXoG7zRX5Q3ZbmpQDGSjBGesk DYrgVhnV5AkvdPv1q3skcQRtCoV3YTXndHu3CTJ9aO9loH77wZrAy7szHgBvDLiaRRWl 502dO/KDpvxKN0IlOGyjsfDnDrtOA6/lg/YZ8eRP3PLcPvWdLnFXgU4vX01CCeg5O77e 5Y9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=5WypuqHXkCccdl/R26KpVsnkXNaYMm+Nyjjc5Bd6u9o=; b=gvWHt2FKQd7alxb3NS7Z8PnwWTZkilct34o0Cf5aH3R2JjRI37NgFkCq3ZTxVbXNJd gvvmAkKkCmr6PeR0wICLjzDYBBdybax1UpEThq4tGQXaFCgc875ai79QKwHSjHt57ToK 6SVsdxPQX/Fo77vmWUeXZVw9QCQEdAo/magnvpvN4hpmfKLXMQvUTQ4pAG/Jq1Qu8o5+ QOxa3cSk7CadoyB+AMgF6lKTXBbTzzJrrGOyL6O6fm0rxCAw4J7MkEqSHPie2Fpr/DEX /2pULBtLISbS9Ppg8PVwws6UQad099ndXOC74liy9LxQBeixLDWpP2DCXrTNj1tcYsug JxHw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a170902ce8400b0017870f47217si4309496plg.360.2022.09.27.19.41.41; Tue, 27 Sep 2022 19:42:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231773AbiI1CVL (ORCPT + 99 others); Tue, 27 Sep 2022 22:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232177AbiI1CVJ (ORCPT ); Tue, 27 Sep 2022 22:21:09 -0400 Received: from p3plwbeout25-03.prod.phx3.secureserver.net (p3plsmtp25-03-2.prod.phx3.secureserver.net [216.69.139.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22FB19C7D5 for ; Tue, 27 Sep 2022 19:21:03 -0700 (PDT) Received: from mailex.mailcore.me ([94.136.40.142]) by :WBEOUT: with ESMTP id dMh2oD5S2109PdMh3okY8A; Tue, 27 Sep 2022 19:21:01 -0700 X-CMAE-Analysis: v=2.4 cv=M+qIlw8s c=1 sm=1 tr=0 ts=6333af8f a=s1hRAmXuQnGNrIj+3lWWVA==:117 a=84ok6UeoqCVsigPHarzEiQ==:17 a=ggZhUymU-5wA:10 a=IkcTkHD0fZMA:10 a=xOM3xZuef0cA:10 a=i0EeH86SAAAA:8 a=IFiPfz1IdY6BvD80mjEA:9 a=QEXdDO2ut3YA:10 a=PeBjCNOBO-z05RTt9keq:22 X-SECURESERVER-ACCT: phillip@squashfs.org.uk X-SID: dMh2oD5S2109P Received: from 82-69-79-175.dsl.in-addr.zen.co.uk ([82.69.79.175] helo=[192.168.178.33]) by smtp10.mailcore.me with esmtpa (Exim 4.94.2) (envelope-from ) id 1odMh1-0002lq-Ot; Wed, 28 Sep 2022 03:21:00 +0100 Message-ID: Date: Wed, 28 Sep 2022 03:20:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH v4 1/2] squashfs: add the mount parameter theads= To: Xiaoming Ni , linux-kernel@vger.kernel.org Cc: wangle6@huawei.com, yi.zhang@huawei.com, wangbing6@huawei.com, zhongjubin@huawei.com, chenjianguo3@huawei.com References: <20220902094855.22666-1-nixiaoming@huawei.com> <20220916083604.33408-1-nixiaoming@huawei.com> <20220916083604.33408-2-nixiaoming@huawei.com> From: Phillip Lougher In-Reply-To: <20220916083604.33408-2-nixiaoming@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailcore-Auth: 439999529 X-Mailcore-Domain: 1394945 X-123-reg-Authenticated: phillip@squashfs.org.uk X-Originating-IP: 82.69.79.175 X-CMAE-Envelope: MS4xfLt+YC+V61+bPXwx1hXMcvUwR0BP9Fdt0Nv/ik/vGhROr+UCVdcIFai9UPRrHbOCOi0AY7+CflQNiT7wYYH/nmeNgq6qstbVKqWUeJwfMc8gwyxaOUw0 lUf0n9qunJC6VUzKUqFLKmxqKC0zdx5a3bj8p2Gmlou+S6YZ8FxUxm45pxv63T4h/AqNSiFdRBJ7eshtWfLsPF19MA1imqpYC2Q= X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 On 16/09/2022 09:36, Xiaoming Ni wrote: > Squashfs supports three decompression concurrency modes: > Single-thread mode: concurrent reads are blocked and the memory > overhead is small. > Multi-thread mode/percpu mode: reduces concurrent read blocking but > increases memory overhead. > > The corresponding schema must be fixed at compile time. During mounting, > the concurrent decompression mode cannot be adjusted based on file read > blocking. > > The mount parameter theads= is added to select > the concurrent decompression mode of a single SquashFS file system > image. > > Signed-off-by: Xiaoming Ni > > +#ifdef CONFIG_SQUASHFS_DECOMP_SINGLE > + opts->thread_ops = &squashfs_decompressor_single; > +#elif CONFIG_SQUASHFS_DECOMP_MULTI > + opts->thread_ops = &squashfs_decompressor_multi; > +#elif CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU In my previous review I asked you to fix the above two #elif lines. You have done so in this patch series, but, only in the second patch which seems perverse. The reason why this isn't a good approach. If you *only* apply this patch, with the following Squashfs configuration options phillip@phoenix:/external/stripe/linux$ grep SQUASHFS .config CONFIG_SQUASHFS=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 is not set # CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y CONFIG_SQUASHFS_XATTR=y CONFIG_SQUASHFS_ZLIB=y CONFIG_SQUASHFS_LZ4=y CONFIG_SQUASHFS_LZO=y CONFIG_SQUASHFS_XZ=y CONFIG_SQUASHFS_ZSTD=y # CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set # CONFIG_SQUASHFS_EMBEDDED is not set CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 You will get the following build warning phillip@phoenix:/external/stripe/linux$ make bzImage SYNC include/config/auto.conf.cmd CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh DESCEND objtool CHK include/generated/compile.h UPD kernel/config_data GZIP kernel/config_data.gz CC kernel/configs.o AR kernel/built-in.a CC fs/squashfs/block.o CC fs/squashfs/cache.o CC fs/squashfs/dir.o CC fs/squashfs/export.o CC fs/squashfs/file.o CC fs/squashfs/fragment.o CC fs/squashfs/id.o CC fs/squashfs/inode.o CC fs/squashfs/namei.o CC fs/squashfs/super.o fs/squashfs/super.c: In function ‘squashfs_init_fs_context’: fs/squashfs/super.c:492:7: warning: "CONFIG_SQUASHFS_DECOMP_MULTI" is not defined, evaluates to 0 [-Wundef] 492 | #elif CONFIG_SQUASHFS_DECOMP_MULTI | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ This strictly breaks the git bisectability rule. Every patch should be compilable and not break the build or produce warnings. If not it makes git bisect difficult to use to find regressions. This can be avoided by fixing the issue in *this* patch. So please do so. Thanks Phillip > + opts->thread_ops = &squashfs_decompressor_percpu; > +#endif > fc->fs_private = opts; > fc->ops = &squashfs_context_ops; > return 0; > @@ -478,7 +526,7 @@ static void squashfs_put_super(struct super_block *sb) > squashfs_cache_delete(sbi->block_cache); > squashfs_cache_delete(sbi->fragment_cache); > squashfs_cache_delete(sbi->read_page); > - squashfs_decompressor_destroy(sbi); > + sbi->thread_ops->destroy(sbi); > kfree(sbi->id_table); > kfree(sbi->fragment_index); > kfree(sbi->meta_index);