[RHEL7,COMMIT] kernel, cgroup: Add abilty to enable css_stacks debuging via kernel command line

Submitted by Konstantin Khorenko on May 19, 2020, 6:31 p.m.

Details

Message ID 202005191831.04JIVYwi008192@finist-ce7.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko May 19, 2020, 6:31 p.m.
The commit is pushed to "branch-rh7-3.10.0-1127.8.2.vz7.151.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.8.2.vz7.151.2
------>
commit e953f005532c8a267ca0116ce47067fa818f2fd7
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Tue May 19 21:31:34 2020 +0300

    kernel,cgroup: Add abilty to enable css_stacks debuging via kernel command line
    
    Add "css_stacks" parameter to kernel's command line to enable css_stacks
    debug at boot.
    
    https://jira.sw.ru/browse/PSBM-98148
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 kernel/cgroup.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 17ba1ab9c7b04..bf218e88ac9dc 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4192,6 +4192,7 @@  static int css_stacks_set(void *data, u64 val)
 DEFINE_SIMPLE_ATTRIBUTE(css_stacks_fops,
 		css_stacks_get, css_stacks_set, "%llu\n");
 
+int setup_css_stacks_cmd;
 static int __init css_stacks_debugfs(void)
 {
 	void *ret;
@@ -4200,9 +4201,18 @@  static int __init css_stacks_debugfs(void)
 			&css_stacks_fops);
 	if (!ret)
 		pr_warn("Failed to create css_stacks in debugfs");
+	if (setup_css_stacks_cmd)
+		static_key_slow_inc(&css_stacks_on);
 	return 0;
 }
 late_initcall(css_stacks_debugfs);
+
+static int __init setup_css_stacks(char *str)
+{
+	setup_css_stacks_cmd = 1;
+	return 1;
+}
+__setup("css_stacks", setup_css_stacks);
 #endif
 
 static void init_cgroup_css(struct cgroup_subsys_state *css,