[lkml]   [2016]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCHSET] kernfs, cgroup: reimplement "cgroup.procs" reading for v2
On cgroup v1, the pid listings in "cgroup.procs" and "tasks" are
sorted which adds a lot of complications and overhead. v2 doesn't
have such requirement and has been intentionally using a modified
sorting order so that the output doesn't look sorted to users.

This patchset re-implements "cgroup.procs" reading for v2 which simply
keeps a css_task_iter open while the file is being read. Keeping the
iterator open makes it unnecessary to skip to the right position on
each read segment and associated errors - e.g. incorrectly skipping
over pids because earlier pids disappeared between the reads.

Using persistent iterator across multiple read calls requires
->release() callback to clean it up. kernfs operations
->open/release() are added and piped through cftype.

This patchset contains the following five patches.


0001 is a misc kernfs patch and 0002 adds ->open/release() to kernfs.
0003 pipes ->open/release() through cftype. 0004 implements the new
cgroup.procs for v2 and 0005 removes the now unused sort order frying

Greg, would it be okay to route the kernfs patches through

The patches are also available in the following git branch.

git:// review-cgroup2-procs

diffstat follows. Thanks.

fs/kernfs/dir.c | 2
fs/kernfs/file.c | 53 +++++++++++++++--
fs/kernfs/kernfs-internal.h | 2
include/linux/cgroup-defs.h | 3 +
include/linux/kernfs.h | 12 +++-
kernel/cgroup.c | 130 +++++++++++++++++++++++++++++---------------
6 files changed, 148 insertions(+), 54 deletions(-)


 \ /
  Last update: 2016-12-20 17:14    [W:0.077 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site