Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp30711pxb; Wed, 4 Nov 2020 13:34:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5lSNgImX+8EvijeTdK8t9qohvWx8dOSweBJo8QzIGYZiOCqNWrbGNlEZnN3uYEYXRVKFu X-Received: by 2002:a17:906:6d52:: with SMTP id a18mr96718ejt.224.1604525640755; Wed, 04 Nov 2020 13:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604525640; cv=none; d=google.com; s=arc-20160816; b=j3TkReNpKARUhERvaEyGWC5oQpbaYZmFFI7sblc0j/qfiKq/y1lXyGV6XhSBI4pb2S tpOAxh1NQIgqqZYVbQXoDnzyAaIOfECH/56CH32U9rLUdHS5C5e/FCsI0zbBxZ6vzFxN 5++/GGIU7GFt3vrwPMwdGHa5jLEsPSyy0ON8ipbF9UyhKu5s6U8Kt4qJp8UgjWa3xO2s h+uRT49UoxUWgNq8w3WxC+VRQdaBM372Yjebv8YZaU3wD6R7WofA1/z5DT9iyURNCUOu PnCdgTO44BURPrK3bdKiI71FNgZWj1PpfdNmmGv6V/paeiWKmAsIlHJYDNPP/58tVmow tYgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/QjMNV0gmbFejQP/+uoncF4mRUUm4/dummX3VyqDMNA=; b=KcoDpZn/aW1qa5Nu0hJvwaqxFWco1t0V0VG3rw7WPDlFulQOYyvjuKgdOWKN5mDUMN ASQAYePWwCRqaqqrOMvo7LLhwphVoKjkTkGwIicgllJiHCxIeFFg5wP0nzFSIluuIsGQ Q51Wx0KO6ESdLUOrgQaGSsJci1jIKhlMEXgdb0cFRZlgK1P4JDIq9hTRfXNPhdRSO9h4 08Wx5OtCem7dtSfzz49m9whzhRkCIoTQ33TJbrtjHnzR6LCIcqPNd4Hzk/0EF0fIpmju FoLO4sbjJ9rdfK71/SpOBkBdfP0voDXO5KDLvJeOdDcTg1/Rw/BkTICqQNQnh88XlyUq 1l/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H8T3PGFW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si2242664edk.387.2020.11.04.13.33.30; Wed, 04 Nov 2020 13:34:00 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H8T3PGFW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730933AbgKDVZn (ORCPT + 99 others); Wed, 4 Nov 2020 16:25:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729600AbgKDVZn (ORCPT ); Wed, 4 Nov 2020 16:25:43 -0500 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A374C0613D3 for ; Wed, 4 Nov 2020 13:25:43 -0800 (PST) Received: by mail-ej1-x644.google.com with SMTP id j24so31826160ejc.11 for ; Wed, 04 Nov 2020 13:25:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/QjMNV0gmbFejQP/+uoncF4mRUUm4/dummX3VyqDMNA=; b=H8T3PGFWuzbHdkF8BvJQfm8okjPL61yS28D5927tKqMgDYeH6y4gTFfpyoeEfOdx5S 1qrVrc6G/+A1yPHywunSo4n4SGEVGDUzNDIAl8N5+VpSQsas+8yJyVhIs4KB7G0loaVe dyUvG0XS2g80FaYY9P5iHfhYO6PjmEx7/+forYj86za/u944Y2/FcEmgYGBuGoySZyIF iREl/b5iSoUsM+FDcjYz/Kxi7gD8dOgWTrJNiSUB4ixDUGSUUXH5klugZHCYuwt+0aOk zNsCJ8Dk9jYWHBCwRq4pZTiJodanESFF1IhZo1FbaRLH207KC8agtwBE1/DcAOOG9R5d 7HcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/QjMNV0gmbFejQP/+uoncF4mRUUm4/dummX3VyqDMNA=; b=PAAyedFjbMyZIRBuhdnx5iqwdJBHoma94s0VMDzAJIM2kZ6LCVvzlxPEVv4rPzT27p O410vFWnYoVI1b57Z9laIKPwL92yoUVIMaKeBtcNSIYnjSbuaDP+EfHphWCzGrAFEVYM Yy+Xlq8xKxit35xJeit8ymSVpvLz8o80RhSs4ThvudjnHn0LFLM4TImsv4nCoM1wJ//0 ZA4oCTC+15n9lhQuGwcnOw3d3h2xvkuDjyS9VaetaQCi6wbrFPaRSNvA0LomBUUOKkSz /yFOh+17bxHl5PoI5CrkbovVNW6YLRpsQlNXTFRhm47QnB1gS98IZlA5lQfdVu3wBNhL Ji7Q== X-Gm-Message-State: AOAM5326kLPpwKPnGBEW4oO8bHN05cd+J9eFBWxZVecqSZyohK6zZkZl ErODSmcORMMt5xdFszU4z4D1Wt5qHNZswGdgvRBK+dSeusuU7g== X-Received: by 2002:a17:906:640d:: with SMTP id d13mr29438ejm.223.1604525141729; Wed, 04 Nov 2020 13:25:41 -0800 (PST) MIME-Version: 1.0 References: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> <20201031200518.4178786-6-harshadshirwadkar@gmail.com> <20201103163850.GI3440@quack2.suse.cz> In-Reply-To: <20201103163850.GI3440@quack2.suse.cz> From: harshad shirwadkar Date: Wed, 4 Nov 2020 13:25:30 -0800 Message-ID: Subject: Re: [PATCH 05/10] jbd2: fix fast commit journalling APIs To: Jan Kara Cc: Ext4 Developers List , "Theodore Y. Ts'o" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Nov 3, 2020 at 8:38 AM Jan Kara wrote: > > 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. Okay thanks for pointing this out. I'll break this commit into logical patches for the next version. > > > 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." Ack > > > + * 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. Ack, Thanks, Harshad > > Honza > -- > Jan Kara > SUSE Labs, CR