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>,
"Zefan Li" <lizefan.x@bytedance.com>,
tglx@linutronix.de
Subject: Re: [PATCH v4 4/6] kernfs: Don't re-lock kernfs_root::kernfs_rwsem in kernfs_fop_readdir().
Date: Mon, 27 Jan 2025 10:02:00 +0100 [thread overview]
Message-ID: <20250127090200.lEQ2Igag@linutronix.de> (raw)
In-Reply-To: <Z5QfFLaywTAdmHoh@slm.duckdns.org>
On 2025-01-24 13:15:32 [-1000], Tejun Heo wrote:
> Hello,
>
> On Fri, Jan 24, 2025 at 06:46:12PM +0100, Sebastian Andrzej Siewior wrote:
> ...
> > to avoid holding a global lock during a page fault. The lock drop is
> > wrong since the support of renames and not a big burden since the lock
> > is no longer global.
>
> It's still a pretty big lock. Hopefully, at least name accesses can be
> converted to rcu protected ones later?
Not sure what you mean by "rcu protected ones". The name is already RCU
protected which is part of the problem :P
Assuming an upper length of name to be around 255 and
kernfs_fop_readdir() to be very early on the chain then we could copy
the name on stack within the RCU section and do this without
::kernfs_rwsem.
> > Don't re-acquire kernfs_root::kernfs_rwsem while copying the name to the
> > userpace buffer.
> >
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> Acked-by: Tejun Heo <tj@kernel.org>
>
> Thanks.
Sebastian
next prev parent reply other threads:[~2025-01-27 9:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 17:46 [PATCH v4 0/6] kernfs: Use RCU to access kernfs_node::{parent|name} Sebastian Andrzej Siewior
2025-01-24 17:46 ` [PATCH v4 1/6] kernfs: Acquire kernfs_rwsem in kernfs_notify_workfn() Sebastian Andrzej Siewior
2025-01-24 23:09 ` Tejun Heo
2025-01-24 17:46 ` [PATCH v4 2/6] kernfs: Acquire kernfs_rwsem in kernfs_get_parent_dentry() Sebastian Andrzej Siewior
2025-01-24 23:11 ` Tejun Heo
2025-01-27 8:42 ` Sebastian Andrzej Siewior
2025-01-24 17:46 ` [PATCH v4 3/6] kernfs: Acquire kernfs_rwsem in kernfs_node_dentry() Sebastian Andrzej Siewior
2025-01-24 23:12 ` Tejun Heo
2025-01-24 17:46 ` [PATCH v4 4/6] kernfs: Don't re-lock kernfs_root::kernfs_rwsem in kernfs_fop_readdir() Sebastian Andrzej Siewior
2025-01-24 23:15 ` Tejun Heo
2025-01-27 9:02 ` Sebastian Andrzej Siewior [this message]
2025-01-27 18:01 ` Tejun Heo
2025-01-24 17:46 ` [PATCH v4 5/6] kernfs: Use RCU to access kernfs_node::parent Sebastian Andrzej Siewior
2025-01-24 23:35 ` Tejun Heo
2025-01-27 16:25 ` Sebastian Andrzej Siewior
2025-01-27 18:00 ` Tejun Heo
2025-01-24 17:46 ` [PATCH v4 6/6] kernfs: Use RCU to access kernfs_node::name Sebastian Andrzej Siewior
2025-01-24 23:41 ` Tejun Heo
2025-01-27 16:17 ` Sebastian Andrzej Siewior
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=20250127090200.lEQ2Igag@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=lizefan.x@bytedance.com \
--cc=mkoutny@suse.com \
--cc=paulmck@kernel.org \
--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