[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250129142134.VTa3D3xT@linutronix.de>
Date: Wed, 29 Jan 2025 15:21:34 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Tejun Heo <tj@...nel.org>
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Michal Koutný <mkoutny@...e.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Hillf Danton <hdanton@...a.com>,
Johannes Weiner <hannes@...xchg.org>,
Marco Elver <elver@...gle.com>, tglx@...utronix.de,
syzbot+6ea37e2e6ffccf41a7e6@...kaller.appspotmail.com
Subject: Re: [PATCH v5 6/6] kernfs: Use RCU to access kernfs_node::name.
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
Powered by blists - more mailing lists