mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Tejun Heo <tj@kernel.org>
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Michal Koutný" <mkoutny@suse.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Hillf Danton" <hdanton@sina.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Marco Elver" <elver@google.com>,
	tglx@linutronix.de,
	syzbot+6ea37e2e6ffccf41a7e6@syzkaller.appspotmail.com
Subject: Re: [PATCH v5 6/6] kernfs: Use RCU to access kernfs_node::name.
Date: Wed, 29 Jan 2025 15:21:34 +0100	[thread overview]
Message-ID: <20250129142134.VTa3D3xT@linutronix.de> (raw)
In-Reply-To: <Z5lAqVmFkMoFACae@slm.duckdns.org>

On 2025-01-28 10:40:09 [-1000], Tejun Heo wrote:
> On Tue, Jan 28, 2025 at 09:42:26AM +0100, Sebastian Andrzej Siewior wrote:
> > Using RCU lifetime rules to access kernfs_node::name can avoid the
> > trouble kernfs_rename_lock in kernfs_name() and kernfs_path_from_node()
> > if the fs was created with KERNFS_ROOT_INVARIANT_PARENT. This is useful
> > as it allows to implement kernfs_path_from_node() only with RCU
> > protection and avoiding kernfs_rename_lock. The lock is only required if
> > the __parent node can be changed and the function requires an unchanged
> > hierarchy while it iterates from the node to its parent.
> 
> A short mention of how avoiding kernfs_rename_lock matters would be great -
> ie. where did this show up?

I extended it:
| Using RCU lifetime rules to access kernfs_node::name can avoid the
| trouble with kernfs_rename_lock in kernfs_name() and kernfs_path_from_node()
| if the fs was created with KERNFS_ROOT_INVARIANT_PARENT. This is usefull
| as it allows to implement kernfs_path_from_node() only with RCU
| protection and avoiding kernfs_rename_lock. The lock is only required if
| the __parent node can be changed and the function requires an unchanged
| hierarchy while it iterates from the node to its parent.
starting here->
| The change is needed to allow the lookup of the node's path
| (kernfs_path_from_node()) from context which runs always with disabled
| preemption and or interrutps even on PREEMPT_RT. The problem is that
| kernfs_rename_lock becomes a sleeping lock on PREEMPT_RT.

Sebastian

      reply	other threads:[~2025-01-29 14:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28  8:42 [PATCH v5 0/6] kernfs: Use RCU to access kernfs_node::{parent|name} Sebastian Andrzej Siewior
2025-01-28  8:42 ` [PATCH v5 1/6] kernfs: Acquire kernfs_rwsem in kernfs_notify_workfn() Sebastian Andrzej Siewior
2025-01-28  8:42 ` [PATCH v5 2/6] kernfs: Acquire kernfs_rwsem in kernfs_get_parent_dentry() Sebastian Andrzej Siewior
2025-01-28  8:42 ` [PATCH v5 3/6] kernfs: Acquire kernfs_rwsem in kernfs_node_dentry() Sebastian Andrzej Siewior
2025-01-28  8:42 ` [PATCH v5 4/6] kernfs: Don't re-lock kernfs_root::kernfs_rwsem in kernfs_fop_readdir() Sebastian Andrzej Siewior
2025-01-28  8:42 ` [PATCH v5 5/6] kernfs: Use RCU to access kernfs_node::parent Sebastian Andrzej Siewior
2025-01-28 20:31   ` Tejun Heo
2025-01-29 13:23     ` Sebastian Andrzej Siewior
2025-01-29 16:54       ` Tejun Heo
2025-01-29 20:26         ` Sebastian Andrzej Siewior
2025-01-29 20:29           ` Tejun Heo
2025-01-28  8:42 ` [PATCH v5 6/6] kernfs: Use RCU to access kernfs_node::name Sebastian Andrzej Siewior
2025-01-28 20:40   ` Tejun Heo
2025-01-29 14:21     ` Sebastian Andrzej Siewior [this message]

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=20250129142134.VTa3D3xT@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=boqun.feng@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=elver@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkoutny@suse.com \
    --cc=paulmck@kernel.org \
    --cc=syzbot+6ea37e2e6ffccf41a7e6@syzkaller.appspotmail.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.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

Powered by JetHome