Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1271826pxu; Mon, 23 Nov 2020 16:39:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJz74onBk5/D8KltVtEr6tlUfXQS0gxU7Sntq7LLfEgX76bUEOUuwG9ObfDe2RB7Tdnen4ia X-Received: by 2002:a17:906:2581:: with SMTP id m1mr1996890ejb.28.1606178371967; Mon, 23 Nov 2020 16:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606178371; cv=none; d=google.com; s=arc-20160816; b=p5D/WvsT4nmBJ+KQokd1cHSaxJeGzsu5ECKilh92/5GqOnC8Nm0cL/n15efIZ/6C2+ 0E47MEUJ6VvHda2PoKlpyEsEx+A5bEN1SrpBvH5OI8eDbEox7SpXZbVqRsjgrvcTtiav wNtLqVyggu+ZJ48qqn2GgP4MW/rPLa5a+XP9m1smlVI7V06N4te7Oilqli/fvN+yBdEl RVvffHTer2cC9BvuYCgHMEQd5K+qHMOYwpYfh5tryZHcWWrg9d1lBwgRm2MddV36M0W8 xW7ebjgnHBDal5tL8VjEuz4wg1Wqyq3Dx1EkoTlGbzSG2aHLel1rfXP/VaDkrx7ab82f hdtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=CZTFxKsmo7oauyaWjnGM6GiE8qc7+BEh7JuqqvZ/qDY=; b=EgIChy6PLUQwiGFzaJzo/x69O1DU1IW6Hq76ow4yYShdskEcfHoW6z3BnerTg9akJG BMZI8mxM9lWl0h5K0Jx24PqQAdLZqG+VqNyBGqtDJ4HL9dkeRnRO31DutUnYpDZDNDYi evpZMydnk3kmcLyKeLetZ52VAJu9RHPuNDtX7KuLNZTcdX8TSHFrbH4fqut29xqKwWxw pJGSeHqgMto2OIAGJEi/q/fQJw1EEAr/9bCZS5YaqZRoLExeYHCPPPWOtYTvUq9eA+Li y0Nmr/OPauJIaYBVIUVpzZ4FxzN1wEOCfp/SKxsKyGxpV/KvQctTqvpHSorizKlYj2o8 PkHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b22si7965602edn.380.2020.11.23.16.38.54; Mon, 23 Nov 2020 16:39:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725817AbgKWXQm (ORCPT + 99 others); Mon, 23 Nov 2020 18:16:42 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:43306 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725308AbgKWXQl (ORCPT ); Mon, 23 Nov 2020 18:16:41 -0500 Received: from callcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 0ANNGXqh014777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Nov 2020 18:16:34 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id C2CB1420136; Mon, 23 Nov 2020 18:16:33 -0500 (EST) Date: Mon, 23 Nov 2020 18:16:33 -0500 From: "Theodore Y. Ts'o" To: Saranya Muruganandam Cc: linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, Li Xi , Wang Shilong Subject: Re: [RFC PATCH v3 10/61] e2fsck: optionally configure one pfsck thread Message-ID: <20201123231633.GJ132317@mit.edu> References: <20201118153947.3394530-1-saranyamohan@google.com> <20201118153947.3394530-11-saranyamohan@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201118153947.3394530-11-saranyamohan@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Nov 18, 2020 at 07:38:56AM -0800, Saranya Muruganandam wrote: > From: Li Xi > > This patch creates only one thread to do pass1 check. The same > codes can be used to create multiple threads, but other functions > need to be modified to get ready for that. > > pfsck support will be enabled with if configured with > --enable-pfsck option. This patch should probably be merged with patch #1 ("e2fsck: add -m option for multithread"). That will make it be *much* easier to review. What I'd actually suggest is that we add some multi-threading support into libext2fs as separate commits, and put them *first* in the patch series. They should ideally have their own unit tests so they can be individually tested, but that way we can also review the library changes *first* to make sure they make sense, and that way the reviewer will understand what the library functions are before reviewing the e2fsck patches. I'd then also follow that up with a commit which compiles e2fsck with the pthread library (and we need to make sure that is portable across different OS's, and that it works when linking both statically and dynamically), and then follow that up with e2fsck utility functions that make life easier for the multi-threading changes --- for example, a thread-safe logging abstraction. Finally, I'd then add support to enable parallel fsck via a configure option, with the default controlled by whether or not pthread support is enabled. (My main concern will be that there may be some minimal C libraries which don't have threading support, when e2fsprogs is compiled in some embedded environment.) I'm not convinced that it makes sense to have a command-line thread to enable multi-threading. What probably makes more sense is to have extended e2fsck option (using -E multithread, which takes an optional argument indicating how many threads should be used). In production, the default of whether or not multi-threading should be enabled would be via /etc/e2fsck.conf. - Ted