x86/resctrl: Add task resctrl information display
authorChen Yu <yu.c.chen@intel.com>
Wed, 15 Jan 2020 09:28:51 +0000 (17:28 +0800)
committerBorislav Petkov <bp@suse.de>
Mon, 20 Jan 2020 15:19:10 +0000 (16:19 +0100)
commite79f15a4598c1f3f3f7f3319ca308c63c91fdaf2
treeddd82880c6aa0d623de777e89946d4d96d07884a
parent536a0d8e79fb928f2735db37dda95682b6754f9a
x86/resctrl: Add task resctrl information display

Monitoring tools that want to find out which resctrl control and monitor
groups a task belongs to must currently read the "tasks" file in every
group until they locate the process ID.

Add an additional file /proc/{pid}/cpu_resctrl_groups to provide this
information:

1)   res:
     mon:

resctrl is not available.

2)   res:/
     mon:

Task is part of the root resctrl control group, and it is not associated
to any monitor group.

3)  res:/
    mon:mon0

Task is part of the root resctrl control group and monitor group mon0.

4)  res:group0
    mon:

Task is part of resctrl control group group0, and it is not associated
to any monitor group.

5) res:group0
   mon:mon1

Task is part of resctrl control group group0 and monitor group mon1.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Jinshi Chen <jinshi.chen@intel.com>
Link: https://lkml.kernel.org/r/20200115092851.14761-1-yu.c.chen@intel.com
arch/x86/Kconfig
arch/x86/kernel/cpu/resctrl/rdtgroup.c
fs/proc/Kconfig
fs/proc/base.c
include/linux/resctrl.h [new file with mode: 0644]