aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched_autogroup.c5
-rw-r--r--kernel/sched_debug.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/kernel/sched_autogroup.c b/kernel/sched_autogroup.c
index 32a723b8f84c..938d52f80a2d 100644
--- a/kernel/sched_autogroup.c
+++ b/kernel/sched_autogroup.c
@@ -231,6 +231,11 @@ void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m)
231#ifdef CONFIG_SCHED_DEBUG 231#ifdef CONFIG_SCHED_DEBUG
232static inline int autogroup_path(struct task_group *tg, char *buf, int buflen) 232static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
233{ 233{
234 int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled);
235
236 if (!enabled || !tg->autogroup)
237 return 0;
238
234 return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id); 239 return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id);
235} 240}
236#endif /* CONFIG_SCHED_DEBUG */ 241#endif /* CONFIG_SCHED_DEBUG */
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 4d36f3726da7..e4d37259d490 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -93,6 +93,9 @@ static char group_path[PATH_MAX];
93 93
94static char *task_group_path(struct task_group *tg) 94static char *task_group_path(struct task_group *tg)
95{ 95{
96 if (autogroup_path(tg, group_path, PATH_MAX))
97 return group_path;
98
96 /* 99 /*
97 * May be NULL if the underlying cgroup isn't fully-created yet 100 * May be NULL if the underlying cgroup isn't fully-created yet
98 */ 101 */