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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12136C433EF for ; Tue, 17 May 2022 13:49:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6EB466B0072; Tue, 17 May 2022 09:49:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 69B1C6B0073; Tue, 17 May 2022 09:49:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 589E36B0074; Tue, 17 May 2022 09:49:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 497DD6B0072 for ; Tue, 17 May 2022 09:49:11 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 12B8E32BA5 for ; Tue, 17 May 2022 13:49:11 +0000 (UTC) X-FDA: 79475366502.19.1936C37 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf19.hostedemail.com (Postfix) with ESMTP id 37FFE1A008C for ; Tue, 17 May 2022 13:49:00 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D2FAECE1A31; Tue, 17 May 2022 13:49:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B6F0C34116; Tue, 17 May 2022 13:49:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652795344; bh=ptVftuJ5so5El75pHlR/1Uw+fbkvm5Gy0tQ0MngQe8I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rxll6opapEVoVsMd4liJdySaUQU0qYFhokppKb8FDuH1YGhkL21HUOyo75gCaOak1 eSzwAvm7MZUgNKYNJ+KomK6YqKCDdmToWHrcIUTVM3NrVMta/1vlUgf5quV2ob8n+C 9RXEOPANp2YTnhPYagJD092oV7nPqPcJhNECSuPTL2pMeY2PvUY8VXMeXsZ6ZojHVa q6LbSNMqhah+7brNWjvFdW/3GqHfEaPerBD+nes3UENH+dfAG83mpg34yh3wzUc/t+ 0J/C9lehGg286KghCEeQR3/h1/JIPer3QMexX5uuHcLVNp7V6MUk5sC9T2EZsptDKH LiH/eIGO7uP7g== Date: Tue, 17 May 2022 15:48:54 +0200 From: Christian Brauner To: Jan Kara Cc: Stefan Roesch , io-uring@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, david@fromorbit.com Subject: Re: [RFC PATCH v2 08/16] fs: add pending file update time flag. Message-ID: <20220517134854.qxb7cif7hvbsbkgd@wittgenstein> References: <20220516164718.2419891-1-shr@fb.com> <20220516164718.2419891-9-shr@fb.com> <20220517112816.ygkadxcjcfcirauo@quack3.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220517112816.ygkadxcjcfcirauo@quack3.lan> X-Stat-Signature: qm8jwgtp4zf4giuakwc5n8nbkurpqyp7 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 37FFE1A008C X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=rxll6opa; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of brauner@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=brauner@kernel.org X-HE-Tag: 1652795340-699259 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, May 17, 2022 at 01:28:16PM +0200, Jan Kara wrote: > On Mon 16-05-22 09:47:10, Stefan Roesch wrote: > > This introduces an optimization for the update time flag and async > > buffered writes. While an update of the file modification time is > > pending and is handled by the workers, concurrent writes do not need > > to wait for this time update to complete. > > > > Signed-off-by: Stefan Roesch > > --- > > fs/inode.c | 1 + > > include/linux/fs.h | 3 +++ > > 2 files changed, 4 insertions(+) > > > > diff --git a/fs/inode.c b/fs/inode.c > > index 1d0b02763e98..fd18b2c1b7c4 100644 > > --- a/fs/inode.c > > +++ b/fs/inode.c > > @@ -2091,6 +2091,7 @@ static int do_file_update_time(struct inode *inode, struct file *file, > > return 0; > > > > ret = inode_update_time(inode, now, sync_mode); > > + inode->i_flags &= ~S_PENDING_TIME; > > So what protects this update of inode->i_flags? Usually we use > inode->i_rwsem for that but not all file_update_time() callers hold it... I think the confusion might come about because file_modified() mentions that the caller is expected to hold file's inode_lock()... Another reason why we should probably add more kernel doc with a "Context:" line explaining what locks are expected to be held to these helpers.