Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp18359rdb; Wed, 1 Nov 2023 15:24:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE83QlxBMwl1Vo9U0JYeF7GsquUNIuXX06DoKrBilRmG6UmJVXCSf2VG0TUt/+ZBR/mTk73 X-Received: by 2002:a05:6a21:7802:b0:181:19ef:4ff0 with SMTP id be2-20020a056a21780200b0018119ef4ff0mr4949557pzc.35.1698877460981; Wed, 01 Nov 2023 15:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698877460; cv=none; d=google.com; s=arc-20160816; b=B+B275zRxm+sf/bei+PpEY5a1ez6lcudFO6LBjordqIdvVuINKfbSFDffSfV2piLHU TkVOJEnmZqrBJLuxWtGEazLY1EDfcQDVI2HKuy4xGOgE87+2DBuzwICVnvVDkUv7hLUB SEN0suhiXkH1bhPX6GlDZjnrkSRUfBEgcMwZLAt485nsvqGanWCLrukWb1B6P4dWU87n y+3ZWVQqjQvQeUDcxFq6Ab2S0DGd+TIEGd9Bvk8Q0VQGfXeK4C0xAOJwbzP4kibibEWJ TkqrtyOTVfXbDssqVijJQE6ipdbPEFRKnln6eIo6jfYxKMp9lp75qZYWH8V9pSrg/370 mhzw== 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=mox8X1H7M1pwsHX7MvCw8LITDXcjbr+sDfYdWZtZU/s=; fh=cwVLpDNXa3Y3nEkenEtJN678l8Hksj3+V8veJMlRFC0=; b=wZ6JP5bPEFukNcBPKYBlvP/VMfNwmgb6VM2X9xUz1YhQqYL0Or9gNBxUJYioFVx27x b/wfgKuK/FjthJybK86NR7LiUGd/gag9ZgX1U9yEtjB3tYKBHwfPzafjPxBOSOeRye19 G0RKyBMDOmf6WZrpemnMcSo3eC1+Ax7rb9MpISbkf5GGoTSiHq5jInq9v64PxtU1GTq+ 9gVWEneq0XBzbjWGdvL1N2dGR7lHwnGZykzJV3MvzDi/EcBM6YCw6B1L4tEfClwgFq8b VVwNnrDOh4mUwGWr2K0NxTTHQUdiDny4v/xZ25a+ES0FtdC+jQzKeG4S7cbr3MZJRcDc MTcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QbH5jNaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d14-20020a17090ab30e00b0027748734bb9si1708736pjr.148.2023.11.01.15.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 15:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QbH5jNaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7FA6A80B81F7; Wed, 1 Nov 2023 15:24:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345831AbjKAWYR (ORCPT + 99 others); Wed, 1 Nov 2023 18:24:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345828AbjKAWYP (ORCPT ); Wed, 1 Nov 2023 18:24:15 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E593010F for ; Wed, 1 Nov 2023 15:24:07 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-509109104e2so254110e87.3 for ; Wed, 01 Nov 2023 15:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1698877446; x=1699482246; 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=mox8X1H7M1pwsHX7MvCw8LITDXcjbr+sDfYdWZtZU/s=; b=QbH5jNaqn/k0/kUpnW/ymSeROeH5TNFKe3GGFKLITZ/yvUwhmsKIlyCbYvjKoiBZ/C sdDMrFcPTFWYCeXivYSsQ/UtZW8mU/XKw+rVycBocxvPCYi90o2H/B5mPv5ozkqmjCTA i4wPquc+Ch+jdj+GlDJyu+34tIME7eGE+yWPM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698877446; x=1699482246; 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=mox8X1H7M1pwsHX7MvCw8LITDXcjbr+sDfYdWZtZU/s=; b=ujo1ZQaNON9BYDRYsTnSExRPSS2XGhq7R8r4+3omrakNlYZiVLQsa8d95t2BEncbWT O9VZ4bQk6KMEZ1+8a2901taYtWUdVM/oHLcCjOqFvY0S3wLQpZWMrhSwNDbY9j+BGFJj AWbW4M+RIfnIG5Z406XkVnAp9dJ2RTv+siAygiX58gFnSEL8mP4uOQjiKGn/VMCI331k q24naXOE4Wm8oWyfuUVx4hoy9e2CuOj3g0Xwz/IoUPZc4+dxCyy9R7+isOZFBQFvuke/ rBj/9Y1u/af1JnnJbOjqczEjh5qEo/KmSZV5CwpJHp51oOP90piXO9quFfPqkJQqLeZj wj/A== X-Gm-Message-State: AOJu0YzypSQ2/+/WgIg/6uTf8akxniLEk/nhIOO1cuyEPewKZVX9asV9 vHMVkOu9DXjTawOLxEbpUspcecMOA044z/q2aWllZ00O X-Received: by 2002:ac2:546e:0:b0:507:9855:bc68 with SMTP id e14-20020ac2546e000000b005079855bc68mr12235001lfn.37.1698877445870; Wed, 01 Nov 2023 15:24:05 -0700 (PDT) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id p10-20020a05640243ca00b005436d751abbsm1526596edc.83.2023.11.01.15.24.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Nov 2023 15:24:03 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-9a6190af24aso47447966b.0 for ; Wed, 01 Nov 2023 15:24:03 -0700 (PDT) X-Received: by 2002:a17:906:ee8b:b0:9be:263b:e31e with SMTP id wt11-20020a170906ee8b00b009be263be31emr2561024ejb.33.1698877442973; Wed, 01 Nov 2023 15:24:02 -0700 (PDT) MIME-Version: 1.0 References: <2ef9ac6180e47bc9cc8edef20648a000367c4ed2.camel@kernel.org> <6df5ea54463526a3d898ed2bd8a005166caa9381.camel@kernel.org> <3d6a4c21626e6bbb86761a6d39e0fafaf30a4a4d.camel@kernel.org> <20231101101648.zjloqo5su6bbxzff@quack3> <3ae88800184f03b152aba6e4a95ebf26e854dd63.camel@hammerspace.com> In-Reply-To: <3ae88800184f03b152aba6e4a95ebf26e854dd63.camel@hammerspace.com> From: Linus Torvalds Date: Wed, 1 Nov 2023 12:23:44 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 2/9] timekeeping: new interfaces for multigrain timestamp handing To: Trond Myklebust Cc: Jan Kara , Chris Mason , Josef Bacik , John Stultz , "Darrick J. Wong" , Christian Brauner , Chandan Babu R , Hugh Dickins , linux-xfs , Dave Chinner , Andrew Morton , dsterba@suse.com, Linux Kernel Mailing List , Jeff Layton , Thomas Gleixner , Linux-MM , "open list:NFS, SUNRPC, AND..." , "Theodore Ts'o" , Al Viro , Ext4 Developers List , Amir Goldstein , linux-btrfs , linux-fsdevel , Andreas Dilger , Kent Overstreet , Stephen Boyd , David Howells , Jan Kara Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 15:24:19 -0700 (PDT) On Wed, Nov 1, 2023, 11:35 Trond Myklebust wrote: > > My client writes to the file and immediately reads the ctime. A 3rd > party client then writes immediately after my ctime read. > A reboot occurs (maybe minutes later), then I re-read the ctime, and > get the same value as before the 3rd party write. > > Yes, most of the time that is better than the naked ctime, but not > across a reboot. Ahh, I knew I was missing something. But I think it's fixable, with an additional rule: - when generating STATX_CHANGE_COOKIE, if the ctime matches the current time and the ctime counter is zero, set the ctime counter to 1. That means that you will have *spurious* cache invalidations of such cached data after a reboot, but only for reads that happened right after the file was written. Now, it's obviously not unheard of to finish writing a file, and then immediately reading the results again. But at least those caches should be somewhat limited (and the problem then only happens when the nfs server is rebooted). I *assume* that the whole thundering herd issue with lots of clients tends to be for stable files, not files that were just written and then immediately cached? I dunno. I'm sure there's still some thinko here. Linus