mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 14:30:58 +07:00
sched: add uid information to sched_debug for CONFIG_USER_SCHED
Impact: extend information in /proc/sched_debug This patch adds uid information in sched_debug for CONFIG_USER_SCHED Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
70574a996f
commit
6c415b9234
@ -2218,6 +2218,7 @@ extern void normalize_rt_tasks(void);
|
|||||||
extern struct task_group init_task_group;
|
extern struct task_group init_task_group;
|
||||||
#ifdef CONFIG_USER_SCHED
|
#ifdef CONFIG_USER_SCHED
|
||||||
extern struct task_group root_task_group;
|
extern struct task_group root_task_group;
|
||||||
|
extern void set_tg_uid(struct user_struct *user);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern struct task_group *sched_create_group(struct task_group *parent);
|
extern struct task_group *sched_create_group(struct task_group *parent);
|
||||||
|
@ -261,6 +261,10 @@ struct task_group {
|
|||||||
struct cgroup_subsys_state css;
|
struct cgroup_subsys_state css;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_USER_SCHED
|
||||||
|
uid_t uid;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_FAIR_GROUP_SCHED
|
#ifdef CONFIG_FAIR_GROUP_SCHED
|
||||||
/* schedulable entities of this group on each cpu */
|
/* schedulable entities of this group on each cpu */
|
||||||
struct sched_entity **se;
|
struct sched_entity **se;
|
||||||
@ -286,6 +290,12 @@ struct task_group {
|
|||||||
|
|
||||||
#ifdef CONFIG_USER_SCHED
|
#ifdef CONFIG_USER_SCHED
|
||||||
|
|
||||||
|
/* Helper function to pass uid information to create_sched_user() */
|
||||||
|
void set_tg_uid(struct user_struct *user)
|
||||||
|
{
|
||||||
|
user->tg->uid = user->uid;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Root task group.
|
* Root task group.
|
||||||
* Every UID task group (including init_task_group aka UID-0) will
|
* Every UID task group (including init_task_group aka UID-0) will
|
||||||
|
@ -160,10 +160,14 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
|
|||||||
cgroup_path(tg->css.cgroup, path, sizeof(path));
|
cgroup_path(tg->css.cgroup, path, sizeof(path));
|
||||||
|
|
||||||
SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
|
SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
|
||||||
|
#elif defined(CONFIG_USER_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
|
||||||
|
{
|
||||||
|
uid_t uid = cfs_rq->tg->uid;
|
||||||
|
SEQ_printf(m, "\ncfs_rq[%d] for UID: %u\n", cpu, uid);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
|
SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
|
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
|
||||||
SPLIT_NS(cfs_rq->exec_clock));
|
SPLIT_NS(cfs_rq->exec_clock));
|
||||||
|
|
||||||
|
@ -101,6 +101,8 @@ static int sched_create_user(struct user_struct *up)
|
|||||||
if (IS_ERR(up->tg))
|
if (IS_ERR(up->tg))
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
|
|
||||||
|
set_tg_uid(up);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user