public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] cgroup: Sync cgroup id and inode number
@ 2019-11-04  8:45 Namhyung Kim
  2019-11-04  8:45 ` [PATCH v2 1/2] kernfs: Convert to u64 id Namhyung Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Namhyung Kim @ 2019-11-04  8:45 UTC (permalink / raw)
  To: Tejun Heo, Johannes Weiner, Li Zefan
  Cc: LKML, Greg Kroah-Hartman, Rafael J. Wysocki, Song Liu, cgroups

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(-)

-- 
2.23.0.700.g56cf767bdb-goog


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-04 18:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-04  8:45 [PATCH v2 0/2] cgroup: Sync cgroup id and inode number Namhyung Kim
2019-11-04  8:45 ` [PATCH v2 1/2] kernfs: Convert to u64 id Namhyung Kim
2019-11-04 13:59   ` Steven Rostedt
2019-11-04  8:45 ` [PATCH v2 2/2] cgroup: Use 64bit id from kernfs Namhyung Kim
2019-11-04 18:58   ` David Miller
2019-11-04 16:49 ` [PATCH v2 0/2] cgroup: Sync cgroup id and inode number Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox