linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/2] Introduce cgroup.top interface
@ 2022-08-26  1:15 Lu Jialin
  2022-08-26  1:15 ` [RFC 1/2] cgroup: Introduce per-cgroup resource top show interface Lu Jialin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lu Jialin @ 2022-08-26  1:15 UTC (permalink / raw)
  To: Zefan Li, Tejun Heo, Johannes Weiner, Andrew Morton,
	Michal Hocko, Roman Gushchin, Shakeel Butt, Muchun Song
  Cc: Lu Jialin, Xiu Jianfeng, cgroups, linux-kernel, linux-mm

Cgroup is used to organize and manage resource available processes.
Currently there are no handy tool for gathering reousrce usage
information for each and every child cgroups, makes it hard to detect
resource outage and debug resource issues.

To overcome this, we present the cgroup.top interface. Just like the
top command, user is able to easily gather resource usage information
, allowing user to detect and respond to resource outage in child
cgroups

Show case:
/ # mount -t cgroup2 none /sys/fs/cgroup
/ # cd /sys/fs/cgroup/
/sys/fs/cgroup # echo "+memory" > cgroup.subtree_control
/sys/fs/cgroup # mkdir test1
/sys/fs/cgroup # mkdir test2
/sys/fs/cgroup # mkdir test3
/sys/fs/cgroup # echo $$ > test2/cgroup.procs
/sys/fs/cgroup # cd /test
/test # ./memcg_malloc 512000 &
/test # ./memcg_malloc 512000 &
/test # ./memcg_malloc 512000 &
/test # cd /sys/fs/cgroup
/sys/fs/cgroup # echo $$ > test1/cgroup.procs
/sys/fs/cgroup # cd /test
/test # ./memcg_malloc 512000 &
/test # cd /sys/fs/cgroup
/sys/fs/cgroup # echo $$ > test3/cgroup.procs
/sys/fs/cgroup # cat cgroup.top
memory top:
name            usage           anon            file            kernel
test2           1974272         1671168         0               270336
test1           700416          569344          0               94208
test3           196608          86016           0               86016


Lu Jialin (1):
  memcg: Adapt cgroup.top into per-memcg

Xiu Jianfeng (1):
  cgroup: Introduce per-cgroup resource top show interface

 include/linux/cgroup-defs.h |  1 +
 kernel/cgroup/cgroup.c      | 20 +++++++++
 mm/memcontrol.c             | 87 +++++++++++++++++++++++++++++++++++++
 3 files changed, 108 insertions(+)

-- 
2.17.1


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

end of thread, other threads:[~2022-08-26  9:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26  1:15 [RFC 0/2] Introduce cgroup.top interface Lu Jialin
2022-08-26  1:15 ` [RFC 1/2] cgroup: Introduce per-cgroup resource top show interface Lu Jialin
2022-08-26  1:15 ` [RFC 2/2] memcg: Adapt cgroup.top into per-memcg Lu Jialin
2022-08-26  7:38   ` Michal Hocko
2022-08-26  3:17 ` [RFC 0/2] Introduce cgroup.top interface Tejun Heo
2022-08-26  9:50   ` lujialin (A)

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