Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp825650ybb; Fri, 10 Apr 2020 10:52:43 -0700 (PDT) X-Google-Smtp-Source: APiQypJU1Gbg7Wxz9I5+uYsLrZucxshfqK8Ogv8XPCRk+A9hgju/aejVqt6XiLh/zNdIQjcNs1Z9 X-Received: by 2002:a37:a5c2:: with SMTP id o185mr5093157qke.219.1586541163796; Fri, 10 Apr 2020 10:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586541163; cv=none; d=google.com; s=arc-20160816; b=c/XVybnuC2TNFBYC5YDGE0LWjeAUVmNCoaHrfryOxYI8CyiTBQYp6gGIqFEb1J9m4T +543UYkyBRKR7918eU0qHtvClmN+/slUSlRrgTFD8QRZgFcWR1k9cxJa7myk94mxdywH cgThOK3acm3x2Mp4z+I4W4YfcIJf3AxAjioJsn8iwjIX9EjGGWszI9bn+kZ1sfnsdbfk xTFtu2zOCJSyxHa+iZvwv4xiHYtoY0nJYReEEd4IhOAIGo3iEJyAbpaYs8Go6ubZibYu 2epQlbrzj09zG27zPl0XTbD2ZCk5OxdlX7FNNRLLYGS0mkQPc8OXNLIo+BHNqcsHxFB4 lvpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FGlqgNrrGlA6czGpnHrGWFTa/LGqYJr8f3bHftYfeIw=; b=kk3GJxKUj1LABDgabyQifptG8yCIdpfT06DviRBVFE90N+mujua50v9RT/BH8JXP53 t9B8/SwfFNPU2eYmQheEpOBm5ASyuoFED6EX1qRb8kSOd3NCNQyGxfiJOXk9Dq6PLjgR tyogLEF/BrAJlsGwS9+Vci/T8ziQgHWbQWLvj2AWjcsz6uj85mq4rgblPN8EZp9Equhz 9v2mHfodZq+lrjw2VvGea6gaFvpkQYGE7XhnQnCIhqbhD0mRhJ91EDVceDkUlVx+iWUn IxtwiicyKQaMVGOzd3J+YmzCwhDizEJvVrM/3aBqcRG+dcXulg/Ecy03XopuBEfqjl7W lEjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bVJsBg1A; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w70si1857637qkb.180.2020.04.10.10.52.20; Fri, 10 Apr 2020 10:52:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bVJsBg1A; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 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 S1726650AbgDJRwE (ORCPT + 99 others); Fri, 10 Apr 2020 13:52:04 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:39004 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgDJRwE (ORCPT ); Fri, 10 Apr 2020 13:52:04 -0400 Received: by mail-ot1-f67.google.com with SMTP id x11so2548418otp.6 for ; Fri, 10 Apr 2020 10:52:04 -0700 (PDT) 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=FGlqgNrrGlA6czGpnHrGWFTa/LGqYJr8f3bHftYfeIw=; b=bVJsBg1AlcpTEg9CWE6riA1tvjWxi61pcg+g2VgoJX3p7ff4zkltQsDdGVGkyPjIw3 QdMqT8A2Bf7nis7HQQM8k9ltAISG+ITmo88lF1nTB4k7Nk3Xcs0B0GI7W5MuIWYcX7VQ R5KgRcq/4bn8BoxDh5IxDP+YJINmGm5xKZkpldZ+oOPao+TJSwU1tNOHKHgtEU0V7Jf5 ZE/3Pj+1Beh2IYA8bVeIrYTrljH0zTxoOmN3WgWlvRhY659OUacCCUzAmXbK151gtpxM EkFTkKJ1iqRDbhi5SWMiXbO/yQ+qx1fshpBRR5b/zrP4o+wZKvTr5PA1ybEyG6LGpF0y 1MNw== 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=FGlqgNrrGlA6czGpnHrGWFTa/LGqYJr8f3bHftYfeIw=; b=TYezVS4eU2Xsp30+0D9CP4+Kq4FKxQUIkk5kBRkK2JJBVCmonHGk34rtJzGtYcXl6B HcspMIrTfX/cpzba4IyISoA3/NdFBR7/b3sfdXDjVRL/PAPaemGxpEF7gD38Ac0hQipL dlvNfYMsL+tmATf5OIEEsWw+cy8bHykWhNPbq/j54k4P3OkznPkHUMfyzz4kpX+/qr1n 6hkw/pR1gAziq3zf5XqdetPJw4/IPI023WAvPcHHtdmqw6SXQhMNmEk/aJ0cJP9eH+rO KI8X33LUPT67eja0IWK8F5PCL4jxFe6X1l1HntgwZhT+uH7QZC4ZdVo0nWDhU52w1BnL 275Q== X-Gm-Message-State: AGi0PuZB4l5N4iy56Me7rY0NKkjfI6mmdP1rzX9OM205sxw5jVJyQb0I yp3B+32C6h5zGFqbGEwipNLIuV9eJaLB0fC3OSTf7CqK X-Received: by 2002:a9d:340b:: with SMTP id v11mr5069961otb.14.1586541123610; Fri, 10 Apr 2020 10:52:03 -0700 (PDT) MIME-Version: 1.0 References: <20200408215530.25649-1-harshads@google.com> <20200408215530.25649-3-harshads@google.com> In-Reply-To: From: harshad shirwadkar Date: Fri, 10 Apr 2020 10:51:52 -0700 Message-ID: Subject: Re: [PATCH v6 03/20] ext4, jbd2: add fast commit initialization routines To: Andreas Dilger Cc: Ext4 Developers List , "Theodore Y. Ts'o" Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Apr 10, 2020 at 5:12 AM Andreas Dilger wrote: > > On Apr 8, 2020, at 3:55 PM, Harshad Shirwadkar wrote: > > > > From: Harshad Shirwadkar > > > > Define feature flags for fast commits and add routines to allow ext4 to > > initialize fast commits. Note that we allow 128 blocks to be used for > > fast commits. As of now, that's the default constant value. > > > > Signed-off-by: Harshad Shirwadkar > > > +static inline int ext4_should_fast_commit(struct super_block *sb) > > +{ > > + if (!ext4_has_feature_fast_commit(sb)) > > + return 0; > > + if (!test_opt2(sb, JOURNAL_FAST_COMMIT)) > > + return 0; > > + if (test_opt(sb, QUOTA)) > > + return 0; > > + return 1; > > +} > > This function seems more complex than it should be. In this patch the > ext4_should_fast_commit() function is only called once during mount, but > in later patches it looks like it is called many times per file/inode. > > Why not just check JOURNAL_FAST_COMMIT, and clear it at mount/remount > time if the other conditions prevent fast commits being used at all? > It seems that JOURNAL_FAST_COMMIT is only set if the FAST_COMMIT feature > is already in the superblock, so always doing both checks seems redundant. Sounds good, will fix that in the next version. > > Also, maybe I missed the discussion, but why does having quotas enabled > on the filesystem disable fast commits entirely? I see in patch 11/20 > that EXT4_FC_REASON_QUOTA is a reason not to do fast commit on the quota > inodes themselves, which seems like a reasonable limitation if needed, > but the above check disables FC for any filesystem with quota, and I > can't find anywhere that this line is later removed in this series. Thanks Andreas for catching this. Actually, there is nothing stopping us from enabling fast commits for quota. As it turns out, this is an unintended carry over from an earlier version of the patchset. I'll re-enable it in the next version. Thanks, Harshad > > Cheers, Andreas > > > > >