Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp4080661rdg; Wed, 18 Oct 2023 14:32:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFM2CGeCvyR6MVkpdAiPH1uCF79ZLUQUJHo+Bcbrrpb1RPFPb9T3mroLHRXEdgALsXmvFvV X-Received: by 2002:a17:902:e842:b0:1bf:193a:70b6 with SMTP id t2-20020a170902e84200b001bf193a70b6mr143699plg.5.1697664723255; Wed, 18 Oct 2023 14:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697664723; cv=none; d=google.com; s=arc-20160816; b=GN8yVKyMkVs0SynlvJWzSBMbCbSKhNIVsacGak3yZICGRxbLKxgMBwM+3Bz3C+KjW2 ceDRfTcykA4fS5klHLXxNt3h4D4DtrsqQzo/Yd2TY5RnXUNa3Jm9Bbam3FeUYNnBVWSQ yar8KvJrJKJGKeOVJ/zy2PY3v7vXRy9alDKi49G7yaWGzVcC9xggVNCh8fYJNw3ECB2F dWTOlxa79p3iDg10nItMtNkX9XMgIjPGUp11Qaib87oBe+kQYLl3PhiR708bTvbAy43C gUH05UEmhc5yqGl0PWWk3Y2t2MaSP/e0htm4w0kQGok8vQdr9bciaaYYWEYKdj5aUbm3 yfeA== 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=ECKpgvAUzJR9x6tmoRvOJm7k5hgaq6eXpehPithmdco=; fh=ISiDSzqmWaLh5iND+7SKGYwdebyc+vv4TxeeTTF5U/k=; b=J9gAob7UYc/g6ydrLduc5pajF4256nfypd7asPgptYwscewtmUQbCmCAKT1QdyE5/j sw8tuHlUeI3Ecv5qG6in/xvuFGZMWJD6Il1eb3IoIq/eX7DVVJrZlurY39n/kvcXoFjk UsZHDF38Km4kizZr4B8ebSO7xU+bW8Ov2xxEFHGoXBsWl4qvolHDpC/9KlAqrGSN4/30 G3nbapUcpzHKFoLs+RZXDKGhNNHhm8BcxF6OmdBOA21dXiTL0mgHTHiRHxc8haLFDvnq MBsfa2Xj5H0JxzzAxr9Z/sDk169OsSngzUtq0i/MMnoM2LMgFrD7dLp6yDpdrjDG31ub kkDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ac9dz8zs; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j13-20020a170903024d00b001bc434b9d95si853070plh.156.2023.10.18.14.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ac9dz8zs; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 25B16822037C; Wed, 18 Oct 2023 14:31:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbjJRVb5 (ORCPT + 99 others); Wed, 18 Oct 2023 17:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjJRVb4 (ORCPT ); Wed, 18 Oct 2023 17:31:56 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CAA6EA for ; Wed, 18 Oct 2023 14:31:55 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9ba081173a3so1204809166b.1 for ; Wed, 18 Oct 2023 14:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1697664713; x=1698269513; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ECKpgvAUzJR9x6tmoRvOJm7k5hgaq6eXpehPithmdco=; b=Ac9dz8zswGFxsmltVOx8gzHtiaMUBO2y25lQgNRnhHQxZNz88kigBzIwC13DQTLzHT xfFpACNmpnF2YyEJZNGpquoNzaHQxKFs91OUX1T8x3+tBYvYMC/jK7z8UODjHrnvkNxL KIh5wQhJaXAaAxEH/tEG9R63nF/zDglOleTHs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697664713; x=1698269513; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ECKpgvAUzJR9x6tmoRvOJm7k5hgaq6eXpehPithmdco=; b=bazqMOAyLD/faNu0lJXJv9RuKUBhzYXIRUciP3BIgMCXosRZt3lQRpPEGeniJy/KXh j/KtHfrmemsjG9EuYE2/koFGthT8o7+HjRRCB1bngpf65Mz9v5dSIpU78G+z3+BIxcyF yZm5RiZCKkYo7G/y4uGljDNUP7QgD0hiAGtbsb1Sk8FdiSm/hxDpw7+ba5OdnPxH8zGR lBqoEB4U8INJUab02li+P9pkDDShhy7ddYItY7Aef9ZHPzAN4ptZjz223E+ThGrrfQNW BhcMyFzOvpb/iql9vndaIx8hfKymfw51KsA+2O0GFxpki/zEQfPc8T4ouOY7m/+/74dg EGow== X-Gm-Message-State: AOJu0YwD+YofEpmCvmzJjyhPGOlzNyxX5uxBTiuY5D4fxFZWUj0Dh0Sf vDGbw5fRCJrr2wFbr23Q1pmJbQlhPb54KXBdy2RuEMIX X-Received: by 2002:a17:907:7211:b0:9c4:4b20:44a9 with SMTP id dr17-20020a170907721100b009c44b2044a9mr356588ejc.65.1697664713436; Wed, 18 Oct 2023 14:31:53 -0700 (PDT) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com. [209.85.218.41]) by smtp.gmail.com with ESMTPSA id g22-20020a1709064e5600b009ad7fc17b2asm2337076ejw.224.2023.10.18.14.31.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Oct 2023 14:31:53 -0700 (PDT) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-99357737980so1204467566b.2 for ; Wed, 18 Oct 2023 14:31:53 -0700 (PDT) X-Received: by 2002:a17:907:c0d:b0:9be:7b67:1674 with SMTP id ga13-20020a1709070c0d00b009be7b671674mr409722ejc.3.1697664692747; Wed, 18 Oct 2023 14:31:32 -0700 (PDT) MIME-Version: 1.0 References: <20231018-mgtime-v1-0-4a7a97b1f482@kernel.org> <20231018-mgtime-v1-2-4a7a97b1f482@kernel.org> In-Reply-To: From: Linus Torvalds Date: Wed, 18 Oct 2023 14:31:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 2/9] timekeeping: new interfaces for multigrain timestamp handing To: Jeff Layton Cc: Alexander Viro , Christian Brauner , John Stultz , Thomas Gleixner , Stephen Boyd , Chandan Babu R , "Darrick J. Wong" , Dave Chinner , "Theodore Ts'o" , Andreas Dilger , Chris Mason , Josef Bacik , David Sterba , Hugh Dickins , Andrew Morton , Amir Goldstein , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 14:31:58 -0700 (PDT) On Wed, 18 Oct 2023 at 13:47, Jeff Layton wrote: > > > old_ctime_nsec &= ~I_CTIME_QUERIED; > > if (ts64.tv_nsec > old_ctime_nsec + inode->i_sb->s_time_gran) > > return ts64; > > > > Does that really do what you expect here? current_time will return a > value that has already been through timestamp_truncate. Yeah, you're right. I think you can actually remove the s_time_gran addition. Both the old_ctime_nsec and the current ts64,tv_nsec are already rounded, so just doing if (ts64.tv_nsec > old_ctime_nsec) return ts64; would already guarantee that it's different enough. > current_mgtime is calling ktime_get_real_ts64, which is an existing > interface that does not take the global spinlock and won't advance the > global offset. That call should be quite cheap. Ahh, I did indeed mis-read that as the new one with the lock. I did react to the fact that is_mgtime(inode) itself is horribly expensive if it's not cached (following three quite possibly cold pointers), which was part of that whole "look at I_CTIME_QUERIED instead". I see the pointer chasing as a huge VFS timesink in all my profiles, although usually it's the disgusting security pointer (because selinux creates separate security nodes for each inode, even when the contents are often identical). So I'm a bit sensitive to "follow several pointers from 'struct inode'" patterns from looking at too many instruction profiles. Linus