Skip to content

cgroup: Sync cgroup id and inode number

Namhyung Kim bpf cgroups linux-block lkml netdev oe-kbuild oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v12 patches 12 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2kernfs: Convert to u64 idfs/kernfs/dir.c fs/kernfs/file.c fs/kernfs/inode.c +10 more+207 -1692 replies
2/2cgroup: Use 64bit id from kernfsinclude/linux/cgroup-defs.h include/net/netprio_cgroup.h kernel/cgroup/cgroup.c +1 more+29 -641 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchSteven Rostedt (VMware)David S. Miller
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] cgroup: Sync cgroup id and inode number

Hello,

This patchset changes cgroup inode number and id management to be in sync with kernfs. The cgroup inode number is managed by kernfs but cgroup id is allocated by a separate idr. The idea is to have a single id for internal usage, inode number and file handle which can be accessed from userspace. Actually this work is from Tejun who also provided the idea. I just took over the work and fixed some errors and finally was able to run perf for testing.

The background of this work is that I want to add cgroup sampling feature in the perf event subsystem. As Tejun mentioned that using cgroup id is not enough and it'd better using file handle instead. But getting file handle in perf NMI handler is not possible so I want to get the info from a cgroup node.

The first patch converted kernfs id into a single 64bit number and in the second patch cgroup uses the kernfs id as cgroup id.

The patches are based on the for-next branch in Tejun's cgroup tree. Tested with tools/testing/selftests/cgroup/test_stress.sh.

Thanks
Namhyung

Tejun Heo (2):
kernfs: Convert to u64 id
cgroup: Use 64bit id from kernfs

 fs/kernfs/dir.c                  | 36 +++++++++++++++++++------------
 fs/kernfs/file.c                 |  4 ++--
 fs/kernfs/inode.c                |  4 ++--
 fs/kernfs/kernfs-internal.h      |  2 --
 fs/kernfs/mount.c                | 92 +++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
 include/linux/cgroup-defs.h      | 18 ++++------------
 include/linux/cgroup.h           | 17 +++++++--------
 include/linux/exportfs.h         |  5 +++++
 include/linux/kernfs.h           | 47 +++++++++++++++++++++++++----------------
 include/net/netprio_cgroup.h     |  8 +++----
 include/trace/events/writeback.h | 92 ++++++++++++++++++++++++++++++++++++++++----------------------------------------
 kernel/bpf/helpers.c             |  2 +-
 kernel/cgroup/cgroup.c           | 68 +++++++++++++++++++----------------------------------------
 kernel/trace/blktrace.c          | 66 +++++++++++++++++++++++++++------------------------------
 net/core/filter.c                |  4 ++--
 net/core/netprio_cgroup.c        |  4 ++--
 16 files changed, 236 insertions(+), 233 deletions(-)
Signature · 1 line
2.23.0.700.g56cf767bdb-goog