Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1175436pxu; Mon, 23 Nov 2020 13:41:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdsCYkaj3hepxOLjeNi4BWeX/kBNOrGJQzobbmj/mlQHI1KsA0eB0FC1jDnEDHFrsCu0lj X-Received: by 2002:a17:906:268c:: with SMTP id t12mr1446679ejc.91.1606167695140; Mon, 23 Nov 2020 13:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606167695; cv=none; d=google.com; s=arc-20160816; b=o/p2F20xNHV8ufixliIdYyGVswEpMZSklO9S32zJgXnymtE79ZjXdhEOyAnCPLgfmu HRSPkgcZY70m2fMROHG8BuP2US6CFRzIdDjal4deaeRKIIqCtNuoIHE50GLYbCWi8Vzi VLVk58l9DAIv4twAPeSaCCp5oGzMFX59RIU8vVKb0FMsoXCH7ZPOvkfYC1zZtDX6S5RX 58HIq5Pn9u0KVHihP+DgcWQuYlDiHRCr8Bz2HTxW12JqcTiaPvxFMM3l/Qw0Gi6ZZQoK ONUHayFt9jGWrfXzNozKy1srzhp8wXM60kAgOLvXNocThWOiNNmDMZBjF9kPobQqKDM9 p16A== 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=M1ufHIqK+MP3vve/JLgcwSsVAGGrNiz4BwyOGCU7bBU=; b=MAZVh0f71XDBUGNeXYSfLTrBkMqllsb41H6QM3jUDuJIHd/LGCzdYiJqefE4EUqrS5 ThNXNVaStZOVFJZwOVecEdMBurfiUF7/dZPtQm+W0lQF3JFCfSx8GcNtW/dmD8XkJyZP NITVRc5JLA+ReVPrPy6BSlwNv1bv6IUOzwR95bYQ+85YljaolMNxMCdl5WyjXFPDylFd qgR8zO/VGb2kb/PqiZH8Zv6iaVfM/ShwTDDZbuHnrJ6YmwJzwhWtKlafIP+TMynzjMyX ieC9QJlV2+870d7OxccxbDPK0yHGD848tMny2XjLx41gBbjz6Hm88ZF8u2aBSMehnl5e s98A== 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 k6si7268116eds.482.2020.11.23.13.41.06; Mon, 23 Nov 2020 13:41:35 -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 S1731104AbgKWVih (ORCPT + 99 others); Mon, 23 Nov 2020 16:38:37 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:55772 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731017AbgKWVig (ORCPT ); Mon, 23 Nov 2020 16:38:36 -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 0ANLcQKP016024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Nov 2020 16:38:27 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id ACA8F420136; Mon, 23 Nov 2020 16:38:26 -0500 (EST) Date: Mon, 23 Nov 2020 16:38:26 -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 02/61] e2fsck: copy context when using multi-thread fsck Message-ID: <20201123213826.GE132317@mit.edu> References: <20201118153947.3394530-1-saranyamohan@google.com> <20201118153947.3394530-3-saranyamohan@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201118153947.3394530-3-saranyamohan@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Nov 18, 2020 at 07:38:48AM -0800, Saranya Muruganandam wrote: > From: Li Xi > > This patch only copy the context to a new one when -m is enabled. > It doesn't actually start any thread. When pass1 test finishes, > the new context is copied back to the original context. > > Since the signal handler only changes the original context, so > add global_ctx in "struct e2fsck_struct" and use that to check > whether there is any signal of canceling. > > This patch handles the long jump properly so that all the existing > tests can be passed even the context has been copied. Otherwise, > test f_expisize_ea_del would fail when aborting. The patch description is a bit misleading. What this is really about is adding the infrastructure to start and join threads in pass #1. Since we presumably will add multiple threading support for other passes, the one-line summary and commit description should make this clear, so that in the future, when a future developer is trying to examine the 60+ commits in this patch series, it will be a bit easier for them to understand what is happening. It might also be good to explain the patch series that this only starts a single thread, since this patch series is really only about adding the multi-threading machinery. Some questions which immediately come up is whether it makes sense to have this machinery in e2fsck/pass1.c, or whether some of this is more general and should be in e2fsck/util.c --- although obviously some portion of the code when we are merging the results from the pass will be pass specific. Of course, none of this is in this commit, so it's hard for me to see whether or not it will make sense in the long run. We can refactor the code later, or in a future patch series, but the point is that it's hard for me to tell whether the existing function breakdown makes the most amount of sense in the first reading of the patches. If you have an opinion of what's the better way to do things, having looked at the whole patch series, feel free to move some of the refactoring into the earlier patches; the patch series doesn't have to reflect the developmental history of the changes, and for the purposes of patch review, it's often simpler when you change earlier patches to simplify things --- although that can make it harder since then you'll have to rework later patches. (If it's too hard, it's fine to leave things as they are.) - Ted