Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4524150rwe; Tue, 30 Aug 2022 11:40:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR41kKkI44BLdkPL6TIrYqvOrtEkjE/UgIv94FzzTDzgN5dKa7l5t8S3lPQKN6WFo3CI7zrC X-Received: by 2002:a17:907:1dee:b0:741:4881:c343 with SMTP id og46-20020a1709071dee00b007414881c343mr11141902ejc.684.1661884802265; Tue, 30 Aug 2022 11:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661884802; cv=none; d=google.com; s=arc-20160816; b=Pjx+ptOfKy+Ysd7RciQL5ApdHpAJ45ldhVYyCaBljgkIB5F7ubzYG0vcMyIUlQo9mh TISbafjfyWGHbYc81FhG1d0R7O8L0jqssZMStIZ2Spe6Drgm3PSfSpAOtgFgSYgcYytQ Hjep2Tls4SU4wYkagvLwQ5oMb35huRUOBx6m07ZFKgKBzdSc/5zdXAHqXHCpaw9pCBHt DRY3sL3eJQZTFPzclxka4Spej3c3YiD71XGtUhvODRDDsqRrKLD0IMaXhTTu963X4hRe kc9lXV6ZWeYDjQgL4PtCDEpa17+gMRDyTOdbPw8IhGJWQPcALNay8IxziFzYDsYURQ52 oyJQ== 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:references :cc:to:from:subject:user-agent:mime-version:date:message-id; bh=NTvJrBTB62miu5yES8IYHDFQORVonhx4YGW0Xwh0h8A=; b=gvGt+Ik/oNKSKGVzxSbL0CwDrYKf800Sloujo9cmgR3C3unasqzQWoZJUr8RgdVr8Z 69jVNaSDQXIjsZC5GaiqvxU6zbrwuPh2pD90KCkcm7Ss1TiGBCeDVEgC7rODP5aygkV2 k4Ivnc8IaLnIVeFEifSSIB5Nk/wNzAzR5Uod4MybcKvXLts7vCmWfZBOVH1dSI/dnWTi R3IkCYzju5JBQHU5f/NJSkIoT0BOFXxxljneceIGOwm1RK8GobdCHysu883CbGWS4YO3 +V0o2vEudiWOCB6dsMwlDyW5g+/jpriP3fyITn7FGenlHZS/hQ1huUMDP39PDxrgO/aG Vxmw== 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 wv13-20020a170907080d00b0073c14b6560bsi9568718ejb.177.2022.08.30.11.39.35; Tue, 30 Aug 2022 11:40:02 -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 S230488AbiH3Se6 (ORCPT + 99 others); Tue, 30 Aug 2022 14:34:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbiH3Se4 (ORCPT ); Tue, 30 Aug 2022 14:34:56 -0400 Received: from p3plwbeout25-05.prod.phx3.secureserver.net (p3plsmtp25-05-2.prod.phx3.secureserver.net [216.69.139.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90B5463A9 for ; Tue, 30 Aug 2022 11:34:51 -0700 (PDT) Received: from mailex.mailcore.me ([94.136.40.145]) by :WBEOUT: with ESMTP id T64WoYqP8w3ohT64XoyIRm; Tue, 30 Aug 2022 11:34:49 -0700 X-CMAE-Analysis: v=2.4 cv=OruKdwzt c=1 sm=1 tr=0 ts=630e584a a=7e6w4QD8YWtpVJ/7+iiidw==:117 a=84ok6UeoqCVsigPHarzEiQ==:17 a=ggZhUymU-5wA:10 a=IkcTkHD0fZMA:10 a=biHskzXt2R4A:10 a=sHY0xHeC1OU4nCuA0NUA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=QEXdDO2ut3YA:10 X-SECURESERVER-ACCT: phillip@squashfs.org.uk X-SID: T64WoYqP8w3oh Received: from 82-69-79-175.dsl.in-addr.zen.co.uk ([82.69.79.175] helo=[192.168.178.33]) by smtp07.mailcore.me with esmtpa (Exim 4.94.2) (envelope-from ) id 1oT64V-00087N-MX; Tue, 30 Aug 2022 19:34:48 +0100 Message-ID: Date: Tue, 30 Aug 2022 19:34:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: ping //Re: [PATCH v2 0/2] squashfs: Add the mount parameter "threads=" From: Phillip Lougher 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: <20220815031100.75243-1-nixiaoming@huawei.com> <20220816010052.15764-1-nixiaoming@huawei.com> <8d139f03-7845-9c96-fffc-74fdf8b5d78d@huawei.com> <60b24133-234f-858b-8e71-e183fe72d2bb@squashfs.org.uk> <9c5bddc3-fc93-d76a-1163-0278c8d31dc5@huawei.com> <74fb0469-e593-ed0e-3f9b-5ec535969c78@squashfs.org.uk> In-Reply-To: <74fb0469-e593-ed0e-3f9b-5ec535969c78@squashfs.org.uk> 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: MS4xfMnjqqWvUchMU7D9tqUf6XmIy4S0N1qK+voEl2lbcBIdPnQFrPucremb01hU7q0odlq6aXrj/u1PckkRdwb8FAQLlDk+F6OOYjYTQNjZ7WZeOXmmpzpA RfywJQ9BlneS3JTD1jvS6McmKRxe1vgjt3Ri1O7tUz1K+fi8E2YelRobzYzocoI1illQZgb57qI7n4I2gtFdgaijmuut4Wf1lNg= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 30/08/2022 19:08, Phillip Lougher wrote: > On 30/08/2022 14:38, Xiaoming Ni wrote: >> On 2022/8/29 7:18, Phillip Lougher wrote: >>> As regards points 1 - 3, personally I would add a default kernel >>> configuration option that keeps the existing behaviour, build time >>> selectable only, no additional mount time options.  Then a >>> kernel configuration option that allows the different decompressors >>> to be selected at mount time, but which always builds all the >>> decompressors.  This will avoid the silliness of point 2, and >> Would it be better to allow flexible selection of decompression mode >> combinations? > > I told you I don't like that (*).  I also told you I want the default > behaviour to be the current behaviour. > > Feel free to disagree, but that isn't a good way to get your patch > reviewed or accepted by me. > > Cheers > > Phillip > > (*) Adding options to select the decompressor at mount time, but, >     also allowing only 1 - 2 decompressors to be built is a waste of >     time.  It has the effect of giving something with one hand and >     taking it alway with the other.  Build the lot, this also >     keeps it simple. > > It also splatters super.c with #ifdef CONFIG lines. phillip@phoenix:/external/stripe/linux/fs/squashfs$ grep "CONFIG_" super.c #ifdef CONFIG_SQUASHFS_DECOMP_SINGLE #ifdef CONFIG_SQUASHFS_DECOMP_MULTI #ifdef CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU #ifdef CONFIG_SQUASHFS_DECOMP_SINGLE #ifdef CONFIG_SQUASHFS_DECOMP_MULTI #ifdef CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU #ifdef CONFIG_SQUASHFS_DECOMP_DEFAULT_SINGLE #elif defined(CONFIG_SQUASHFS_DECOMP_DEFAULT_MULTI) #elif defined(CONFIG_SQUASHFS_DECOMP_DEFAULT_PERCPU) Or static int squashfs_parse_param_threads(const char *str, struct squashfs_mount_opts *opts) { unsigned long num; int ret; #ifdef CONFIG_SQUASHFS_DECOMP_SINGLE if (strcmp(str, "single") == 0) { opts->thread_ops = &squashfs_decompressor_single; return 0; } #endif #ifdef CONFIG_SQUASHFS_DECOMP_MULTI if (strcmp(str, "multi") == 0) { opts->thread_ops = &squashfs_decompressor_multi; return 0; } #endif #ifdef CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU if (strcmp(str, "percpu") == 0) { opts->thread_ops = &squashfs_decompressor_percpu; return 0; } #endif ret = kstrtoul(str, 0, &num); if (ret != 0 || num == 0) return -EINVAL; #ifdef CONFIG_SQUASHFS_DECOMP_SINGLE if (num == 1) { opts->thread_ops = &squashfs_decompressor_single; return 0; } #endif #ifdef CONFIG_SQUASHFS_DECOMP_MULTI opts->thread_ops = &squashfs_decompressor_multi; if (num > opts->thread_ops->max_decompressors()) num = opts->thread_ops->max_decompressors(); opts->thread_num = (int)num; return 0; #else return -EINVAL; #endif } SNIP static int squashfs_show_options(struct seq_file *s, struct dentry *root) { struct super_block *sb = root->d_sb; struct squashfs_sb_info *msblk = sb->s_fs_info; if (msblk->panic_on_errors) seq_puts(s, ",errors=panic"); else seq_puts(s, ",errors=continue"); #ifdef CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU /* * thread=percpu and thread= have different configuration effects. * the parameters need to be treated differently when they are displayed. */ if (msblk->thread_ops == &squashfs_decompressor_percpu) { seq_puts(s, ",threads=percpu"); return 0; } #endif seq_printf(s, ",threads=%u", msblk->max_thread_num); return 0; } static int squashfs_init_fs_context(struct fs_context *fc) { struct squashfs_mount_opts *opts; opts = kzalloc(sizeof(*opts), GFP_KERNEL); if (!opts) return -ENOMEM; #ifdef CONFIG_SQUASHFS_DECOMP_DEFAULT_SINGLE opts->thread_ops = &squashfs_decompressor_single; #elif defined(CONFIG_SQUASHFS_DECOMP_DEFAULT_MULTI) opts->thread_ops = &squashfs_decompressor_multi, #elif defined(CONFIG_SQUASHFS_DECOMP_DEFAULT_PERCPU) opts->thread_ops = &squashfs_decompressor_percpu; #endif