linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] cgroup: Sync cgroup id and inode number
@ 2019-10-16 12:50 Namhyung Kim
  2019-10-16 12:50 ` [PATCH 1/2] cgroup: Add generation number with cgroup id Namhyung Kim
  2019-10-16 12:50 ` [PATCH 2/2] kernfs: Allow creation with external gen + ino numbers Namhyung Kim
  0 siblings, 2 replies; 15+ messages in thread
From: Namhyung Kim @ 2019-10-16 12:50 UTC (permalink / raw)
  To: Tejun Heo, Johannes Weiner, Li Zefan
  Cc: LKML, Greg Kroah-Hartman, Rafael J. Wysocki, Song Liu

Hello,

This patchset changes cgroup inode number and id management to be in
sync with kernfs.  Currently cgroup inode is managed by kernfs while
cgroup id is allocated by its own idr.  And kernfs/cgroup file handle
uses inode and generation numbers.  So I added generation number to
cgroup and pass the numbers to kernfs.

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 added generation number to cgroup and the second patch
allows kernfs node created with external generation and inode numbers.

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


Namhyung Kim (2):
  cgroup: Add generation number with cgroup id
  kernfs: Allow creation with external gen + ino numbers

 arch/x86/kernel/cpu/resctrl/rdtgroup.c |  4 +-
 fs/kernfs/dir.c                        | 63 +++++++++++++++++------
 fs/kernfs/file.c                       |  9 ++--
 fs/kernfs/kernfs-internal.h            |  5 ++
 fs/sysfs/file.c                        |  2 +-
 include/linux/cgroup-defs.h            | 12 ++++-
 include/linux/kernfs.h                 | 25 ++++++---
 kernel/cgroup/cgroup.c                 | 70 +++++++++++++++++++-------
 8 files changed, 143 insertions(+), 47 deletions(-)

-- 
2.23.0.700.g56cf767bdb-goog


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

end of thread, other threads:[~2019-11-01  0:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16 12:50 [PATCH 0/2] cgroup: Sync cgroup id and inode number Namhyung Kim
2019-10-16 12:50 ` [PATCH 1/2] cgroup: Add generation number with cgroup id Namhyung Kim
2019-10-24 17:44   ` Tejun Heo
2019-10-25  8:30     ` Namhyung Kim
2019-10-25  9:38       ` Namhyung Kim
2019-10-25 10:56         ` Tejun Heo
2019-10-26 11:32           ` Namhyung Kim
2019-10-25 11:06       ` Tejun Heo
2019-10-25 18:47         ` Tejun Heo
2019-10-26 11:42           ` Namhyung Kim
2019-11-01  0:47             ` Namhyung Kim
2019-10-26 11:40         ` Namhyung Kim
2019-10-16 12:50 ` [PATCH 2/2] kernfs: Allow creation with external gen + ino numbers Namhyung Kim
2019-10-24 17:52   ` Tejun Heo
2019-10-25  8:46     ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).