From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BD57C433DB for ; Mon, 11 Jan 2021 20:24:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E1A9225AC for ; Mon, 11 Jan 2021 20:24:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404229AbhAKUYZ (ORCPT ); Mon, 11 Jan 2021 15:24:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:33318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404215AbhAKUYW (ORCPT ); Mon, 11 Jan 2021 15:24:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADBE1225AC; Mon, 11 Jan 2021 20:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610396621; bh=GuikJIMMynj1JoVdFBbBDyTl6eY4ObOVr2EhJzbluqU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h9UJs0tr0HoLvfoM0v704ZMwvpGKTk+NgiLZEjtFVRGKupALugn+LTjpCVAzgGoDt fnvgqZCF48gZoGU8LQOWMLdCBR5SUO9onTJHG74h3wmPwtP+ZqD8Uc1bVk8LPSBTxa yUdoD94NOU5fUPYrHZIa26l1w+y22BfW7zuWvitBcnnpKeJZ5tWmMijqpzTW2T8RBB v9/ZLCNXfoJCPVqOY000S6pHMovE+IDHJouQmhR6KR2ZjYAtHmgJcISwR8/kY3ESw+ cTvhL/H7nkTKjLz0FryNvH1qL4khOQKIgNyGy1b/Ygf2RyfL1stItYLsoFgFUCLJgg u5yjhlG30NShA== Date: Mon, 11 Jan 2021 12:23:40 -0800 From: Eric Biggers To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Theodore Ts'o Subject: Re: [PATCH v2 11/12] ext4: simplify i_state checks in __ext4_update_other_inode_time() Message-ID: References: <20210109075903.208222-1-ebiggers@kernel.org> <20210109075903.208222-12-ebiggers@kernel.org> <20210111105342.GE2502@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210111105342.GE2502@lst.de> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Jan 11, 2021 at 11:53:42AM +0100, Christoph Hellwig wrote: > On Fri, Jan 08, 2021 at 11:59:02PM -0800, Eric Biggers wrote: > > if ((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW | > > - I_DIRTY_INODE)) || > > - ((inode->i_state & I_DIRTY_TIME) == 0)) > > + I_DIRTY_TIME)) != I_DIRTY_TIME) > > return; > > > > spin_lock(&inode->i_lock); > > - if (((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW | > > - I_DIRTY_INODE)) == 0) && > > - (inode->i_state & I_DIRTY_TIME)) { > > + if ((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW | > > + I_DIRTY_TIME)) == I_DIRTY_TIME) { > > I think a descriptively named inline helper in fs.h would really improve > this.. Do you want this even though it is specific to how ext4 opportunisticly updates other inodes in the same inode block as the inode being updated? That's the only reason that I_FREEING|I_WILL_FREE|I_NEW need to be checked; everywhere else justs want I_DIRTY_TIME. We could add: static inline bool other_inode_has_dirtytime(struct inode *inode) { return (inode->state & (I_FREEING | I_WILL_FREE | I_NEW | I_DIRTY_TIME)) == I_DIRTY_TIME; } But it seems a bit weird when it's specific to ext4 at the moment. Are you thinking that other filesystems will implement the same sort of opportunistic update, so we should add the helper now? - Eric From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 096C9C433DB for ; Mon, 11 Jan 2021 20:24:07 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77C3C22C7B; Mon, 11 Jan 2021 20:24:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77C3C22C7B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1kz3jQ-0001if-V3; Mon, 11 Jan 2021 20:24:04 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz3jP-0001iQ-6u for linux-f2fs-devel@lists.sourceforge.net; Mon, 11 Jan 2021 20:24:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OGupJZqMipXHR+QD3GXHFTQbgGli0bw/Aana2Vtbh+4=; b=fY8YwCBtu2tl+0n0Jt+MZIXHRo g6a4Ort60tFC9dNuObxOKTRMvfxlJ3emdp4qO3EogFffWmmF9REY6Mkd5mz8xWj7zATW/SPBDWrlg LSGKul5PfATysBxgj6jL+Z4HflnGFjpgpJSEi2kB3KiHmhxfOgEE4mYSR7l2+rfWcb30=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=OGupJZqMipXHR+QD3GXHFTQbgGli0bw/Aana2Vtbh+4=; b=YMm3C36aAVY5RKJ6gB7Udenq0x DUV3r2RpPiKwWnzTtvHQrS/KzVloPdYyQGuLu24H9wuAVnVF2erSQtvnhnfdmugzAoCvUoOXoL0Vw TQhVLBw5s+CzpRfmU2a+FkJnoVvPSXh1sJ86dNkuMly5McC04Ims/oRtHsA4mu+uOu28=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kz3jG-001ywW-Nt for linux-f2fs-devel@lists.sourceforge.net; Mon, 11 Jan 2021 20:24:03 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADBE1225AC; Mon, 11 Jan 2021 20:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610396621; bh=GuikJIMMynj1JoVdFBbBDyTl6eY4ObOVr2EhJzbluqU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h9UJs0tr0HoLvfoM0v704ZMwvpGKTk+NgiLZEjtFVRGKupALugn+LTjpCVAzgGoDt fnvgqZCF48gZoGU8LQOWMLdCBR5SUO9onTJHG74h3wmPwtP+ZqD8Uc1bVk8LPSBTxa yUdoD94NOU5fUPYrHZIa26l1w+y22BfW7zuWvitBcnnpKeJZ5tWmMijqpzTW2T8RBB v9/ZLCNXfoJCPVqOY000S6pHMovE+IDHJouQmhR6KR2ZjYAtHmgJcISwR8/kY3ESw+ cTvhL/H7nkTKjLz0FryNvH1qL4khOQKIgNyGy1b/Ygf2RyfL1stItYLsoFgFUCLJgg u5yjhlG30NShA== Date: Mon, 11 Jan 2021 12:23:40 -0800 From: Eric Biggers To: Christoph Hellwig Message-ID: References: <20210109075903.208222-1-ebiggers@kernel.org> <20210109075903.208222-12-ebiggers@kernel.org> <20210111105342.GE2502@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210111105342.GE2502@lst.de> X-Headers-End: 1kz3jG-001ywW-Nt Subject: Re: [f2fs-dev] [PATCH v2 11/12] ext4: simplify i_state checks in __ext4_update_other_inode_time() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, Theodore Ts'o , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Mon, Jan 11, 2021 at 11:53:42AM +0100, Christoph Hellwig wrote: > On Fri, Jan 08, 2021 at 11:59:02PM -0800, Eric Biggers wrote: > > if ((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW | > > - I_DIRTY_INODE)) || > > - ((inode->i_state & I_DIRTY_TIME) == 0)) > > + I_DIRTY_TIME)) != I_DIRTY_TIME) > > return; > > > > spin_lock(&inode->i_lock); > > - if (((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW | > > - I_DIRTY_INODE)) == 0) && > > - (inode->i_state & I_DIRTY_TIME)) { > > + if ((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW | > > + I_DIRTY_TIME)) == I_DIRTY_TIME) { > > I think a descriptively named inline helper in fs.h would really improve > this.. Do you want this even though it is specific to how ext4 opportunisticly updates other inodes in the same inode block as the inode being updated? That's the only reason that I_FREEING|I_WILL_FREE|I_NEW need to be checked; everywhere else justs want I_DIRTY_TIME. We could add: static inline bool other_inode_has_dirtytime(struct inode *inode) { return (inode->state & (I_FREEING | I_WILL_FREE | I_NEW | I_DIRTY_TIME)) == I_DIRTY_TIME; } But it seems a bit weird when it's specific to ext4 at the moment. Are you thinking that other filesystems will implement the same sort of opportunistic update, so we should add the helper now? - Eric _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel