Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121337
b: refs/heads/master
c: 6c415b9
h: refs/heads/master
i:
  121335: 3b90824
v: v3
  • Loading branch information
Arun R Bharadwaj authored and Ingo Molnar committed Dec 1, 2008
1 parent 76781ab commit 43603ad
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70574a996fc7a70c5586eb56bd92a544eccf18b6
refs/heads/master: 6c415b9234a8c71f290e5d4fddc467f103f32719
1 change: 1 addition & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,7 @@ extern void normalize_rt_tasks(void);
extern struct task_group init_task_group;
#ifdef CONFIG_USER_SCHED
extern struct task_group root_task_group;
extern void set_tg_uid(struct user_struct *user);
#endif

extern struct task_group *sched_create_group(struct task_group *parent);
Expand Down
10 changes: 10 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ struct task_group {
struct cgroup_subsys_state css;
#endif

#ifdef CONFIG_USER_SCHED
uid_t uid;
#endif

#ifdef CONFIG_FAIR_GROUP_SCHED
/* schedulable entities of this group on each cpu */
struct sched_entity **se;
Expand All @@ -286,6 +290,12 @@ struct task_group {

#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.
* Every UID task group (including init_task_group aka UID-0) will
Expand Down
6 changes: 5 additions & 1 deletion trunk/kernel/sched_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

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
SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
#endif

SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
SPLIT_NS(cfs_rq->exec_clock));

Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ static int sched_create_user(struct user_struct *up)
if (IS_ERR(up->tg))
rc = -ENOMEM;

set_tg_uid(up);

return rc;
}

Expand Down

0 comments on commit 43603ad

Please sign in to comment.