mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jori Koolstra <jkoolstra@xs4all.nl>
To: Shakeel Butt <shakeel.butt@linux.dev>,
	Christian Brauner <brauner@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tejun Heo <tj@kernel.org>, Ian Kent <raven@themaw.net>,
	"T . J . Mercier" <tjmercier@google.com>,
	Meta kernel team <kernel-team@meta.com>,
	linux-fsdevel@vger.kernel.org, driver-core@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] kernfs: update a directory's times without kernfs_iattr_rwsem
Date: Thu, 3 Dec 2026 15:29:27 +0100 (CET)	[thread overview]
Message-ID: <771874345.3709540.1796308167142@kpc.webmail.kpnmail.nl> (raw)
In-Reply-To: <20261118220154.2965621-6-shakeel.butt@linux.dev>


> Op 18-11-2026 23:01 CET schreef Shakeel Butt <shakeel.butt@linux.dev>:
> 
>  
> kernfs_add_one() and __kernfs_remove() update the parent's ctime and
> mtime under kernfs_iattr_rwsem for writing, inside kernfs_rwsem.  This
> is where cgroup mkdirs block on Meta fleet: the writer waits for every
> path walk's permission check while it holds kernfs_rwsem and
> cgroup_mutex.
> 
> The lock keeps the times stable for getattr, now their only reader, and
> a timespec64 is too wide for a single store.  Give the three times a
> seqlock instead.  setattr takes it in addition to kernfs_iattr_rwsem,
> adding or removing an entry takes only the seqlock, and getattr retries
> if a write was in progress.  Adding or removing an entry reads the clock
> with the seqlock held, so updates store their times in the order they
> happen.  A racing stat() can see the new link count with the old times,
> or the reverse.
> 
> A directory without iattrs still skips the update.

I know this is not a change in behavior, but what is the reason we start
to care about the a/c/mtime only after we have done a setattr. I understand
that kernfs wants to be very stingy on memory use, but why not leave it out
all together then? Is there anything that needs those times only when the
attrs are not default?

Best,
Jori.

  reply	other threads:[~2026-12-03 14:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 22:01 [PATCH 0/6] kernfs: stop taking kernfs_iattr_rwsem for writing in mkdir/rmdir Shakeel Butt
2026-11-18 22:01 ` [PATCH 1/6] kernfs: report times and link count from the node in getattr Shakeel Butt
2026-12-02 16:55   ` Jori Koolstra
2026-11-18 22:01 ` [PATCH 2/6] kernfs: don't copy times and link count into the inode on refresh Shakeel Butt
2026-12-02 17:02   ` Jori Koolstra
2026-11-18 22:01 ` [PATCH 3/6] kernfs: don't take kernfs_iattr_rwsem for the directory counters Shakeel Butt
2026-12-02 17:03   ` Jori Koolstra
2026-11-18 22:01 ` [PATCH 4/6] kernfs: don't take kernfs_iattr_rwsem to publish KERNFS_REMOVING Shakeel Butt
2026-11-20 18:57   ` T.J. Mercier
2026-12-02 17:03   ` Jori Koolstra
2026-11-18 22:01 ` [PATCH 5/6] kernfs: update a directory's times without kernfs_iattr_rwsem Shakeel Butt
2026-12-03 14:29   ` Jori Koolstra [this message]
2026-12-03 16:56     ` Tejun Heo
2026-11-18 22:01 ` [PATCH 6/6] kernfs: don't take kernfs_iattr_rwsem in __kernfs_remove() Shakeel Butt
2026-11-20 11:31 ` [PATCH 0/6] kernfs: stop taking kernfs_iattr_rwsem for writing in mkdir/rmdir Tejun Heo
2026-11-20 18:57 ` T.J. Mercier
2026-11-20 20:42 ` 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=771874345.3709540.1796308167142@kpc.webmail.kpnmail.nl \
    --to=jkoolstra@xs4all.nl \
    --cc=brauner@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@meta.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    --cc=shakeel.butt@linux.dev \
    --cc=tj@kernel.org \
    --cc=tjmercier@google.com \
    /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

all inboxes | Powered by JetHome®