Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp201271rdb; Tue, 31 Oct 2023 05:22:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHq7DottH7hPsuRsw0s14v2yTGtw9IJfHgM3q4/ZvyPI94jax2jWRohlACeG3ND1pz6jKU6 X-Received: by 2002:a05:6358:7e92:b0:169:57f3:755c with SMTP id o18-20020a0563587e9200b0016957f3755cmr8202415rwn.19.1698754931993; Tue, 31 Oct 2023 05:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698754931; cv=none; d=google.com; s=arc-20160816; b=ZGrhTW9pXWR1Xrk+RNcik2O8u3Zc643WFoZtzNnmMVQP/RqtDnWqKKovOt65rbzyef JIu7BsRI8GOkSymN0fQm8m4P8PlEqrBEtJzQ6esStlVppp+iKYSn+bj4WWSjqi7Rmi3P 2YWA2VgVWhKAOt5E8V6pbnG12BHOvi+XKSJNe6lVTUkKzt53/ebSldKJUZP4+ayXswHA BbgANoFfFDXiYrl1M/5163t6QpP1bz8r6akINq3bk9Bq2CGE3uYCQDQE3wyXjuDgssrH /Xr3nlcEVNPqxsBRSaW+F3+OPhWtlZ1h10rKPtBaoPROEfUBwrUNNwGViRnNXUfIUufX h95Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=LxFJRcgKBrTkwCYk/XtrM2vfD36eMy9uV2KLQkafOhY=; fh=P/bca5h8SlSSXNKP8CdREX9+HkctdbBZ+Rg8m0/LxMo=; b=KotzBcLGthVo/60dlBYcY6wj/wmvMUzu4uPkmVkEmqrLevw0w7+30nk/TS25NsSu4J FcfNxPbki83jXzJzwUxlNgGQnvJHoft2Zs2/sbDsgOUQA2J6tVjEb+4Oi1zHy55J/ECH 0CoAWiLupWgVEmPp8437FZskAyfxavAabsmwfnYkWv+fqNLarXqa89udBbdlpRpIaJAV VhW2TumxRkMWNY9hX01EtSC0SDe1FmxZqjtXETgo6qyxOX51qzVFsP3MF8Ubz+iUtZgl WkbyB76ZqdxDP4mfNy34KE0KqKaXOAstDxR3ngqlXkC2y+0dlHxbPQSWl+LE2krFn5kU sO9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=stIqHE18; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ezvTsNdn; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 75-20020a63004e000000b005b92db1e10asi986639pga.692.2023.10.31.05.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 05:22:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=stIqHE18; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ezvTsNdn; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7B20B802FA31; Tue, 31 Oct 2023 05:22:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344044AbjJaMWH (ORCPT + 99 others); Tue, 31 Oct 2023 08:22:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230434AbjJaMWG (ORCPT ); Tue, 31 Oct 2023 08:22:06 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0925D98; Tue, 31 Oct 2023 05:22:02 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9FB961F38C; Tue, 31 Oct 2023 12:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1698754921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LxFJRcgKBrTkwCYk/XtrM2vfD36eMy9uV2KLQkafOhY=; b=stIqHE18hi2qK54I3U59vf2hwUprwpecHKfDAQl0BfZhfY9q7vOh7VQOvfyRIjXKcuCKic KzxtNU5bDMp3XfdhMrN/PHoUj5JOtUvbLJw1Z1SqneYw14oLKXB5dXYyn7z9vA2N6wH7ST 4OCFQZPjOT/CJctCbnuDY/fSgPBEEfM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1698754921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LxFJRcgKBrTkwCYk/XtrM2vfD36eMy9uV2KLQkafOhY=; b=ezvTsNdnRqRV9+SjqugsQVNOwztieZlM3AEVPM4DYQWa5mL9YeU3DWOSCLoXuxS8MGnhK2 d4woXKVGLv2zv/CQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8BBDD1391B; Tue, 31 Oct 2023 12:22:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dhoQImnxQGV9SgAAMHmgww (envelope-from ); Tue, 31 Oct 2023 12:22:01 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 1A429A06E5; Tue, 31 Oct 2023 13:22:01 +0100 (CET) Date: Tue, 31 Oct 2023 13:22:01 +0100 From: Jan Kara To: Jeff Layton Cc: Dave Chinner , Amir Goldstein , Linus Torvalds , Kent Overstreet , Christian Brauner , Alexander Viro , John Stultz , Thomas Gleixner , Stephen Boyd , Chandan Babu R , "Darrick J. Wong" , Theodore Ts'o , Andreas Dilger , Chris Mason , Josef Bacik , David Sterba , Hugh Dickins , Andrew Morton , Jan Kara , David Howells , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH RFC 2/9] timekeeping: new interfaces for multigrain timestamp handing Message-ID: <20231031122201.kmxzttzfbearu6iu@quack3> References: <2ef9ac6180e47bc9cc8edef20648a000367c4ed2.camel@kernel.org> <6df5ea54463526a3d898ed2bd8a005166caa9381.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 05:22:07 -0700 (PDT) On Tue 31-10-23 07:04:53, Jeff Layton wrote: > On Tue, 2023-10-31 at 09:37 +1100, Dave Chinner wrote: > > I have suggested mechanisms for using masked off bits of timestamps > > to encode sub-timestamp granularity change counts and keep them > > invisible to userspace and then not using i_version at all for XFS. > > This avoids all the problems that the multi-grain timestamp > > infrastructure exposed due to variable granularity of user visible > > timestamps and ordering across inodes with different granularity. > > This is potentially a general solution, too. > > I don't really understand this at all, but trying to do anything with > fine-grained timestamps will just run into a lot of the same problems we > hit with the multigrain work. If you still see this as a path forward, > maybe you can describe it more detail? Dave explained a bit more details here [1] like: Another options is for XFS to play it's own internal tricks with [cm]time granularity and turn off i_version. e.g. limit external timestamp visibility to 1us and use the remaining dozen bits of the ns field to hold a change counter for updates within a single coarse timer tick. This guarantees the timestamp changes within a coarse tick for the purposes of change detection, but we don't expose those bits to applications so applications that compare timestamps across inodes won't get things back to front like was happening with the multi-grain timestamps.... - So as far as I understand Dave wants to effectively persist counter in low bits of ctime and expose ctime+counter as its change cookie. I guess that could work and what makes the complexity manageable compared to full multigrain timestamps is the fact that we have one filesystem, one on-disk format etc. The only slight trouble could be that if we previously handed out something in low bits of ctime for XFS, we need to keep handing the same thing out until the inode changes (i.e., no rounding until the moment inode changes) as the old timestamp could be stored somewhere externally and compared. Honza [1] https://lore.kernel.org/all/ZTjMRRqmlJ+fTys2@dread.disaster.area/ -- Jan Kara SUSE Labs, CR