Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8827019ybi; Tue, 23 Jul 2019 16:09:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwln7kpR53jQn7CkAESn6ko0aIY82RePjbAIsrNulCclrtcPHHhk0Z62BkY+NQuuvL0gOZt X-Received: by 2002:a17:902:26c:: with SMTP id 99mr85583457plc.215.1563923342847; Tue, 23 Jul 2019 16:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563923342; cv=none; d=google.com; s=arc-20160816; b=dP/SVWo3sdV5pYXDqSJVixLRqamO/nsoOCc1ZWNGgVxOKLzDNUJ80s3PXWWVtOOI31 4eORVuSn9aGBzgDIJpSgHefO/t6CToGcabfIhQrEri99ORcUzfEBBXo0ANbpS8zSZuHk dRNoXmKWZd8CiXudfK9R67Nf+0iYO7myprj3PdKgBZApAwmE5KLSDgXoxdwXcetmkRMm AlvUfqB7qJDBp6v7F9Nawm+a8VCAyCxDO2BeH/Q1Es8q1uYuT0pkRusNfj44mMIcRHAJ cK+EDO/DIePEIITadTrKhGAJve5M5Nw6HL4gOetav20SHjOh8ZC+JfGKw5wySwrs6VYi ILeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=4TeGseDS+kxMXG22ynfaI6ENxji0m9uNEuofAtWvmNk=; b=gaBLVTxv398NujPikHCF9L5GUWT5I3batF7EUX4YkH4JSz66/jD8pyq9VBep0D1eF0 csGam0AHD2Md1eJeTCAOg4Y03VdCCZthgaK1O1pDB2je9Uk28pfN51dZXdxfMU/iVGng 9vIepr2Ziqyr0IwHLI/KN2tFHYWK65jewZKdnQXTjEqMPXunVF/dOXmm494AAfkiNE6M ctBRMV9iahdF5munUoR/L4SImad3WQL5sDXqtBjbhaq+isnd2EU/THbe0RSKDBp5cKNP 74DOdvhswxKoRrHvZZbV5zCc9rapK2j5/EgxRjxPOISrW0f2BniRCM5AdogPtUyDQ6JY INuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si10758419plp.304.2019.07.23.16.08.47; Tue, 23 Jul 2019 16:09:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730611AbfGWMab (ORCPT + 99 others); Tue, 23 Jul 2019 08:30:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:45866 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726438AbfGWMaa (ORCPT ); Tue, 23 Jul 2019 08:30:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6BAE3AD7B; Tue, 23 Jul 2019 12:30:28 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 3BB05DA7D5; Tue, 23 Jul 2019 14:31:05 +0200 (CEST) Date: Tue, 23 Jul 2019 14:31:05 +0200 From: David Sterba To: Gao Xiang Cc: dsterba@suse.cz, Gao Xiang , Alexander Viro , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , Theodore Ts'o , Linus Torvalds , linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org, LKML , linux-erofs@lists.ozlabs.org, Chao Yu , Miao Xie , Li Guifu , Fang Wei Subject: Re: [PATCH v3 23/24] erofs: introduce cached decompression Message-ID: <20190723123104.GB2868@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Gao Xiang , Gao Xiang , Alexander Viro , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , Theodore Ts'o , Linus Torvalds , linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org, LKML , linux-erofs@lists.ozlabs.org, Chao Yu , Miao Xie , Li Guifu , Fang Wei References: <20190722025043.166344-1-gaoxiang25@huawei.com> <20190722025043.166344-24-gaoxiang25@huawei.com> <20190722101818.GN20977@twin.jikos.cz> <41f1659a-0d16-4316-34fc-335b7d142d5c@aol.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41f1659a-0d16-4316-34fc-335b7d142d5c@aol.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 06:58:59PM +0800, Gao Xiang wrote: > On 2019/7/22 ????6:18, David Sterba wrote: > > On Mon, Jul 22, 2019 at 10:50:42AM +0800, Gao Xiang wrote: > >> +choice > >> + prompt "EROFS Data Decompression mode" > >> + depends on EROFS_FS_ZIP > >> + default EROFS_FS_ZIP_CACHE_READAROUND > >> + help > >> + EROFS supports three options for decompression. > >> + "In-place I/O Only" consumes the minimum memory > >> + with lowest random read. > >> + > >> + "Cached Decompression for readaround" consumes > >> + the maximum memory with highest random read. > >> + > >> + If unsure, select "Cached Decompression for readaround" > >> + > >> +config EROFS_FS_ZIP_CACHE_DISABLED > >> + bool "In-place I/O Only" > >> + help > >> + Read compressed data into page cache and do in-place > >> + I/O decompression directly. > >> + > >> +config EROFS_FS_ZIP_CACHE_READAHEAD > >> + bool "Cached Decompression for readahead" > >> + help > >> + For each request, it caches the last compressed page > >> + for further reading. > >> + It still does in-place I/O for the rest compressed pages. > >> + > >> +config EROFS_FS_ZIP_CACHE_READAROUND > >> + bool "Cached Decompression for readaround" > >> + help > >> + For each request, it caches the both end compressed pages > >> + for further reading. > >> + It still does in-place I/O for the rest compressed pages. > >> + > >> + Recommended for performance priority. > > > > The number of individual Kconfig options is quite high, are you sure you > > need them to be split like that? > > You mean the above? these are 3 cache strategies, which impact the > runtime memory consumption and performance. I tend to leave the above > as it-is... No, I mean all Kconfig options, they're scattered over several patches, best seen in the checked out branch. The cache strategies are actually just one config option (choice). > I'm not sure vm_map_ram() is always better than vmap() for all > platforms (it has noticeable performance impact). However that > seems true for my test machines (x86-64, arm64). > > If vm_map_ram() is always the optimal choice compared with vmap(), > I will remove vmap() entirely, that is OK. But I am not sure for > every platforms though. You can select the implementation by platform, I don't know what are the criteria like cpu type etc, but I expect it's something that can be determined at module load time. Eventually a module parameter can be the the way to set it. > > And so on. I'd suggest to go through all the options and reconsider them > > to be built-in, or runtime settings. Debugging features like the fault > > injections could be useful on non-debugging builds too, so a separate > > option is fine, otherwise grouping other debugging options under the > > main EROFS_FS_DEBUG would look more logical. > > The remaining one is EROFS_FS_CLUSTER_PAGE_LIMIT. It impacts the total > size of z_erofs_pcluster structure. It's a hard limit, and should be > configured as small as possible. I can remove it right now since multi-block > compression is not available now. However, it will be added again after > multi-block compression is supported. > > So, How about leave it right now and use the default value? From the Kconfig and build-time settings perspective I think it's misplaced. This affects testing, you'd have to rebuild and reinstall the module to test any change, while it's "just" a number that can be either module parameter, sysfs knob, mount option or special ioctl. But I may be wrong, EROFS is a special purpose filesystem, so the fine-grained build options might make sense (eg. due to smaller code). The question should be how does each option affect typical production build targets. Fewer is IMHO better.