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 AEF55CEB2C2 for ; Mon, 30 Sep 2024 21:35:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 063D128002A; Mon, 30 Sep 2024 17:35:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 015336B02A1; Mon, 30 Sep 2024 17:35:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E447B28002A; Mon, 30 Sep 2024 17:35:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C6A386B02A0 for ; Mon, 30 Sep 2024 17:35:18 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4968C140914 for ; Mon, 30 Sep 2024 21:35:18 +0000 (UTC) X-FDA: 82622710716.06.7D86F94 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf01.hostedemail.com (Postfix) with ESMTP id 6EBEE40005 for ; Mon, 30 Sep 2024 21:35:16 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=YgR2fuSG; dkim=pass header.d=linutronix.de header.s=2020e header.b=OLBn3xaq; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf01.hostedemail.com: domain of tglx@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=tglx@linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727731977; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uVbdFg6I8fwu/3AqZyEvbGS1WvCMLB3EhLlpsNhR5nI=; b=Zkl7O4qofHxzntVJEBLUteEtgdtyE+b41wtf77mMVgTBeOFOdvSIkVulx7p2JE5fmE5ydA vz2mVJruePYjrailv9NxrQrB5YlCSkZxUHe0kSRjHp/jXL6H3DzMVe3/gfjaDQdoMrUpZ6 oZJhDkW1+TwOC+qBeBxbVvGaEAz31pc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727731977; a=rsa-sha256; cv=none; b=dZHlZcNmyN2SxQiYQJfWvNCsjFgBa05IUAtz6WCGM0oKjfCJfbE942qhdnMZpzzmTjIatx PtBsNbYgIMe8ojGmcjQNqpMu/VQBe73rMKKuS+h3Z6TkHzXGAMPWQ6CojN95W0QbRS+Z4M izRiE79rFjAfCb/Ih0uz4kX4sEI1XDg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=YgR2fuSG; dkim=pass header.d=linutronix.de header.s=2020e header.b=OLBn3xaq; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf01.hostedemail.com: domain of tglx@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=tglx@linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1727732113; h=from:from:reply-to:subject:subject: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=uVbdFg6I8fwu/3AqZyEvbGS1WvCMLB3EhLlpsNhR5nI=; b=YgR2fuSGQ+1CC0G5H4MzE4t8olbAFU5BafUyaLxjF2QIjTs3UbzCwwk7QvMFHeeLW8vuY5 HIuz05kBaI+PAU5kDbE9O5ysw0ZigkKVd+8BT9ZePG9tf2kJcuF4pv35EhkZ99cPbhVZbC GQ7Jjbx9vgE0Rcx85zIefGMO0cL2dvmr4gN0aD9m2NtQeKfb7b8TsCdFADjl1RJyD/x6T5 2c0wF9l6tXZjPe+9VRbHHcVyeREQUnQ1EWRZc+6eA8hsmw0RLjF4PEs0g0/Gf5TgScX/Mf xmwiJC8MCArfDFIIe+35ZCXxip+JZBfa+y8nD1s/uIVBn02yxnXIdg3SaXmy3A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1727732113; h=from:from:reply-to:subject:subject: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=uVbdFg6I8fwu/3AqZyEvbGS1WvCMLB3EhLlpsNhR5nI=; b=OLBn3xaqldkwQyCXLWWfC5gXBWhLeCEwb2syNUFGVZ4mPsvyd455m2aCZBRPk2SHmQTkzb bQfsnyFmm/fDZ2Dg== To: Jeff Layton , John Stultz , Stephen Boyd , Alexander Viro , Christian Brauner , Jan Kara , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Jonathan Corbet , Chandan Babu R , "Darrick J. Wong" , Theodore Ts'o , Andreas Dilger , Chris Mason , Josef Bacik , David Sterba , Hugh Dickins , Andrew Morton , Chuck Lever , Vadim Fedorenko Cc: Randy Dunlap , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v8 01/11] timekeeping: move multigrain timestamp floor handling into timekeeper In-Reply-To: <79a32ab9308d6e63e066aa17c5c2492b51b55850.camel@kernel.org> References: <20240914-mgtime-v8-0-5bd872330bed@kernel.org> <20240914-mgtime-v8-1-5bd872330bed@kernel.org> <87a5g79aag.ffs@tglx> <874j6f99dg.ffs@tglx> <878qv90x6w.ffs@tglx> <4933075b1023f466edb516e86608e0938de28c1d.camel@kernel.org> <87y138zyfu.ffs@tglx> <79a32ab9308d6e63e066aa17c5c2492b51b55850.camel@kernel.org> Date: Mon, 30 Sep 2024 23:35:13 +0200 Message-ID: <87plokzuy6.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6EBEE40005 X-Stat-Signature: ad787pw4n334zctxnuik3pt43rzupopa X-Rspam-User: X-HE-Tag: 1727732116-243301 X-HE-Meta: U2FsdGVkX18MRh+Q/0iBbaneTVIu4kbFSt1arnmzljGthsHotpRzuB3nUlT9rn/viwVVhPW5vWipyJZ/Bv82QER8R44JL75tlidjJ6/vUW5tFcm7COHd4ZlPEHW2/DVQYvq34aXmAegAcQtE1Jftgwt+kRpvtBk7irKw09QWIYgWtte0Ow64557nCyeI6FgyB+h20jTX58WBBSZQFsF8PTgjoBDdItDvmOgAfrpAhtuhiXQLJyX4bEcJEscc9goAmqSmLB35dX/nUMX9iSDSf5Gut0e2jr+C0cFMhU9gFlM2C863lA1nLr04i3RD2iurHIci8WUixgaN5W+gSbK8CiHERjtLAyOW/2W+3mm70yxKirxGOXeJw90vJUM36VTupD/spkXxiC1M8GDc16CS3ZjKBXVnpuaxp9Jp8viv9T81cSF3QmwAm2F8TQuBMmurXKTrGR+w/Vnj5N0JsNn1E66flckaxzbx0GUk3y2oxArvkHK6JndGqgtpMdVF/bq4YwTeD1ozs523+cYX/jsfKiN5gKYtC376JlWzKmcl3TEV0ECKiJsVpTbnmhNZDwKXLHP3NZXre9xeO3NkLUxlLE3JCPkS9s13riwNoUAcCCD5K4gLvFl86VhkEw2Ys4/SIoHayZGJO22jleln+ZBFhGf5nK/f8IQ0vVVGXJZkdCQRl4HAwDfwWqGFA+DmM/7OM+D+UrMAeVGhAKiMUy+0POYp4uC6nKZgM2CN6uc183+yj67f1d9AWR1Yg8FhKSPQD9otSnjw1BZlw7izO8qaPAbt25PZFSJtrMQG1el9TjihswO9ANIGpXWDVt5a+7Z2iMEkm0Im6LfK6/Bu6vvT1snTkWVkuCYuFri9juGriZaH0hOgW1tIVv+C3Er7uO8xwlQizYk2lFE3EBLSOyJyI2hOCHTmWNPxgwdFgt/j5Wu0bPxK6A6HoEhSL/UX2oqiut51yzufREbExpttwcm 8MxpQxzW Q3rAwuoSuCPvgrRmwq5rTLmY2EemifKFAHj9k4Kd+MD4K5cFjVIwKuE2q+i5uRcNMt1H3dPUEVLA/e37OwmIavrAwDm56f0m/5V6CJdUv+N5zFV2Ac5kyTKwwJtbsGcZhIMHJX2rqVDnabr7Uxib2Sf2frQ== 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: List-Subscribe: List-Unsubscribe: On Mon, Sep 30 2024 at 16:53, Jeff Layton wrote: > On Mon, 2024-09-30 at 22:19 +0200, Thomas Gleixner wrote: >> On Mon, Sep 30 2024 at 15:37, Jeff Layton wrote: >> > If however, two threads have racing syscalls that overlap in time, then there >> > is no such guarantee, and the second file may appear to have been modified >> > before, after or at the same time as the first, regardless of which one was >> > submitted first. >> >> That makes me ask a question. Are the timestamps always taken in thread >> (syscall) context or can they be taken in other contexts (worker, >> [soft]interrupt, etc.) too? >> > > That's a good question. > > The main place we do this is inode_set_ctime_current(). That is mostly > called in the context of a syscall or similar sort of operation > (io_uring, nfsd RPC request, etc.). > > I certainly wouldn't rule out a workqueue job calling that function, > but this is something we do while dirtying an inode, and that's not > typically done in interrupt context. The reason I'm asking is that if it's always syscall context, i.e. write() or io_uring()/RPC request etc., then you can avoid the whole global floor value dance and make it strictly per thread, which simplifies the exercise significantly. But even if it's not syscall/thread context then the worker or io_uring state machine might just require to serialize against itself and not coordinate with something else. But what do I know. Thanks, tglx