Re: [PATCH v3 0/3] kernfs: Build paths in linear time with respect to depth

From: Tejun Heo

Date: Sun Nov 29 2026 - 23:45:16 EST


On Sun, Nov 29, 2026 at 07:48:15PM -0800, Chris Down wrote:
> kernfs_path_from_node() walks back up from the leaf for each name in the
> path, so the work grows with the square of the depth, and reading
> /proc/<pid>/cgroup does that with IRQs off and css_set_lock held.
> Patch 1 builds the path in a single walk instead. As Tejun suggested on
> v1, a path which doesn't fit now returns -E2BIG and keeps its end rather
> than its start, with "..." in front of it. Reads of /proc/<pid>/cgroup,
> and of /proc/<pid>/mountinfo with a cgroup mount rooted at such a path,
> fail again as they did before v6.8, when the name loop stopped reporting
> truncation. Patches 2 and 3 update sched/debug, which added its own
> "..." at the end, and cgroup_iter, which assumed that nothing would be
> left in the buffer.

For the series,

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

--
tejun