Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp640297pxb; Tue, 3 Nov 2020 08:39:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdTosc4hk3NCsfBntZz8gOWxhmO+ZWz0WabSOVxHMm4H3hKflcBIbu/6R7f2qCbF7CqWcU X-Received: by 2002:a17:906:6545:: with SMTP id u5mr20783659ejn.346.1604421559346; Tue, 03 Nov 2020 08:39:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604421559; cv=none; d=google.com; s=arc-20160816; b=cwjjod9qEsFUbSxPlL2Y53ZujjZgwbgArdURKBk2FknPe4J45E2Uf1lI7cQXe4+pJD En/CmQxFDJKLdPlb/54Da7piGz1ikK5FAQa3WZi2MjRmB0nZXblgDraSqEbKSyPfCixi ZAvU8Vfyq0K8A03LJWF0AxSv2ay1L8ebi5AVVCR1P4JbHNXiEtSNCg0IaZLNoC74BGXv jMoAREmNVE0mXoX9nEkymy0BXpjlmuozy45wO9ayRoaoVHzKq/yRkqDqaajT8LeFjII7 hcPfVGpT1piQQ/RAx03xzOivciHNp34loxivun5o9ywPOhx4nf6xdQNfjUSyObtD6PB3 LapQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=o8fRv3Xe/IF7dGev3SSKyyakVCpdltBv/ZAw+j4DiAk=; b=HmpU0tuk0pKMv2Bpm21DDPI5uE0XCLeL+yXokLF5MSHl/k7EFLYFP6zo1jBSNmbefv 4yLGR8RM8kfRbcVmJMdyyo2Bp0EIPhlvsMEdC3f9VN9fA7FwbaHAIcEWcSScALfBEHk0 pqsYxXH2f1JSKo1FNMyArsvGYmbnYlUmSbKhcgVfOyHHWkkixBn8x5ae6PYUbEG1a0nw TEtpYwoDiKKbyOizER6HR9UKaZSXd4HyGItXxAgPyboViF98mrml4Cx0RaL1Emfyi72B 3kwTwIKZ88s1JF/8GicRm30OhbDs0BO1cL8xoeoI0U5TXBeGVKvr9p11hbD5rghzw3F2 4Tjg== 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 rl17si12509680ejb.19.2020.11.03.08.38.54; Tue, 03 Nov 2020 08:39:19 -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 S1727883AbgKCQiw (ORCPT + 99 others); Tue, 3 Nov 2020 11:38:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:52366 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbgKCQiv (ORCPT ); Tue, 3 Nov 2020 11:38:51 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C1396ADDB; Tue, 3 Nov 2020 16:38:50 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 6ADF91E12FB; Tue, 3 Nov 2020 17:38:50 +0100 (CET) Date: Tue, 3 Nov 2020 17:38:50 +0100 From: Jan Kara To: Harshad Shirwadkar Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, jack@suse.cz Subject: Re: [PATCH 05/10] jbd2: fix fast commit journalling APIs Message-ID: <20201103163850.GI3440@quack2.suse.cz> References: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> <20201031200518.4178786-6-harshadshirwadkar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201031200518.4178786-6-harshadshirwadkar@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat 31-10-20 13:05:13, Harshad Shirwadkar wrote: > This patch adds a few misc fixes for jbd2 fast commit functions. > > Signed-off-by: Harshad Shirwadkar Please no "misc fixes" patches. If you have trouble writing good explanatory changelog, it's usually a sign you're trying to cram too much into a single commit :). In this case I'd split it into 3 changes: 1) TODO update. 2) Removal of j_state_lock protection (with comment updates) 3) Fix of journal->j_running_transaction->t_tid handling. > diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h > index 9b4e87a0068b..df1285da7276 100644 > --- a/include/linux/jbd2.h > +++ b/include/linux/jbd2.h > @@ -946,7 +946,9 @@ struct journal_s > * @j_fc_off: > * > * Number of fast commit blocks currently allocated. > - * [j_state_lock]. > + * [j_state_lock]. During the commit path, this variable is not Please remove the [j_state_lock] annotation when the entry isn't really protected by j_state_lock... Also I'd maybe rephrase the comment like "Accessed only during fastcommit, currenly only a single process can perform fastcommit at a time." > + * protected by j_state_lock since only one process performs commit > + * at a time. > */ > unsigned long j_fc_off; > > @@ -1110,7 +1112,9 @@ struct journal_s > > /** > * @j_fc_wbuf: Array of fast commit bhs for > - * jbd2_journal_commit_transaction. > + * jbd2_journal_commit_transaction. During the commit path, this > + * variable is not protected by j_state_lock since only one process > + * performs commit at a time. > */ > struct buffer_head **j_fc_wbuf; Here the bh's aren't really used in jbd2_journal_commit_transaction() are they? Please fix that when updating the comment. Also I'd find a reformulation like I suggested for the comment above more comprehensible. Honza -- Jan Kara SUSE Labs, CR