linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Jeff Layton <jlayton@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Boqun Feng <boqun.feng@gmail.com>, Neil Brown <neilb@suse.de>
Subject: Re: [PATCH v4 2/9] fs: add infrastructure for multigrain inode i_m/ctime
Date: Sat, 20 May 2023 16:06:43 -0400	[thread overview]
Message-ID: <ZGkoU6Wfcst6scNk@mit.edu> (raw)
In-Reply-To: <20230518114742.128950-3-jlayton@kernel.org>

On Thu, May 18, 2023 at 07:47:35AM -0400, Jeff Layton wrote:
> Use the 31st bit of the ctime tv_nsec field to indicate that something
> has queried the inode for the i_mtime or i_ctime. When this flag is set,
> on the next timestamp update, the kernel can fetch a fine-grained
> timestamp instead of the usual coarse-grained one.

TIL....  that atomic_long_fetch_or() and atomic_long_fetch_andnot()
exist.  :-)

When I went looking for documentation about why they do or this
particular usage pattern found in the patch, I didn't find any --- at
least, certainly not in the Documentation in the kernel sources.  The
closest that I fond was this LWN article written by Neil Brown from
2016:

	https://lwn.net/Articles/698315/

... and this only covered the use atomic_fetch_or(); I wasn't able to
find anything discussing atomic_fetch_andnot().

It looks like Peter Zijlstra added some bare-bones documentation in
2017, in commit: 706eeb3e9c6f ("Documentation/locking/atomic: Add
documents for new atomic_t APIs") so we do have Documentation that
these functions *exist*, but there is nothing explaining what they do,
or how they can be used (e.g., in this rather clever way to set and
clear a flag in the high bits of the nsec field).

I know that it's best to report missing documentation in the form of a
patch, but I fear I don't have the time or the expertise to really do
this topic justice, so I'd just thought I'd just note this lack for
now, and maybe in my copious spare time I'll try to get at least
something that will no doubt contain errors, but might inspire some
folks to correct the text.  (Or maybe on someone on linux-doc will
feel inspired and get there ahead of me.  :-)

					- Ted

  reply	other threads:[~2023-05-20 20:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 11:47 [PATCH v4 0/9] fs: implement multigrain timestamps Jeff Layton
2023-05-18 11:47 ` [PATCH v4 1/9] fs: pass the request_mask to generic_fillattr Jeff Layton
2023-05-23  9:17   ` Jan Kara
2023-05-18 11:47 ` [PATCH v4 2/9] fs: add infrastructure for multigrain inode i_m/ctime Jeff Layton
2023-05-20 20:06   ` Theodore Ts'o [this message]
2023-05-21  2:21     ` Boqun Feng
2023-05-21  8:11       ` Paul E. McKenney
2023-05-21  8:32         ` Paul E. McKenney
2023-05-23 10:02   ` Jan Kara
2023-05-23 10:17     ` Jan Kara
2023-05-23 10:56       ` Jeff Layton
2023-05-23 11:01         ` Christian Brauner
2023-05-23 11:15           ` Jeff Layton
2023-06-13 19:47       ` Jeff Layton
2023-05-23 10:38     ` Christian Brauner
2023-05-23 10:40     ` Jeff Layton
2023-05-23 12:46       ` Jan Kara
2023-06-13 13:09         ` Jeff Layton
2023-06-14  6:29           ` Christian Brauner
2023-05-18 11:47 ` [PATCH v4 3/9] overlayfs: allow it to handle multigrain timestamps Jeff Layton
2023-05-18 11:47 ` [PATCH v4 4/9] nfsd: ensure we use ctime_peek to grab the inode->i_ctime Jeff Layton
2023-05-18 13:43   ` Chuck Lever III
2023-05-18 15:31     ` Jeff Layton
2023-05-19 10:36       ` Christian Brauner
2023-05-19 11:22         ` Jeff Layton
2023-05-18 11:47 ` [PATCH v4 5/9] ksmbd: use ctime_peek to grab the ctime out of the inode Jeff Layton
2023-05-18 11:47 ` [PATCH v4 6/9] tmpfs: add support for multigrain timestamps Jeff Layton
2023-05-18 11:47 ` [PATCH v4 7/9] xfs: switch to " Jeff Layton
2023-05-18 11:47 ` [PATCH v4 8/9] ext4: convert " Jeff Layton
2023-05-20 20:29   ` Theodore Ts'o
2023-05-18 11:47 ` [PATCH v4 9/9] btrfs: " Jeff Layton
2023-05-22  9:56   ` David Sterba
2023-05-22 10:08     ` Jeff Layton
2023-05-22 10:53       ` Christian Brauner
2023-05-22  9:54 ` [PATCH v4 0/9] fs: implement " Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZGkoU6Wfcst6scNk@mit.edu \
    --to=tytso@mit.edu \
    --cc=boqun.feng@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).