--- eb27a9faa17ac149a02d11464ff0809f6842d83c +++ 95297f2c284ebeed72c63256397c783efbc289d4 @@ -350,16 +350,15 @@ struct task_group init_task_group; /* return group to which a task belongs */ static inline struct task_group *task_group(struct task_struct *p) { -#ifdef CONFIG_USER_SCHED struct task_group *tg; +#ifdef CONFIG_USER_SCHED rcu_read_lock(); tg = __task_cred(p)->user->tg; rcu_read_unlock(); return tg; #elif defined(CONFIG_CGROUP_SCHED) - struct task_group *tg; struct cgroup_subsys_state *css; css = task_subsys_state(p, cpu_cgroup_subsys_id); @@ -367,8 +366,6 @@ static inline struct task_group *task_gr return autogroup_task_group(p, tg); #else - struct task_group *tg; - tg = &init_task_group; return tg; @@ -5224,21 +5221,9 @@ void account_idle_time(cputime_t cputime struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat; cputime64_t cputime64 = cputime_to_cputime64(cputime); struct rq *rq = this_rq(); - struct task_struct *task; - if (atomic_read(&rq->nr_iowait) > 0) { - for (task = current; task != &init_task; task = task->parent) - ; - /* task now points to init */ - for_each_process(task) { - /* this pointlessly prints the name and PID of each task */ - if (task->in_iowait) { - task->iowait = cputime64_add(task->iowait, cputime64); - //printk("%s[%d]\n", task->comm, task->pid); - } - } + if (atomic_read(&rq->nr_iowait) > 0) cpustat->iowait = cputime64_add(cpustat->iowait, cputime64); - } else cpustat->idle = cputime64_add(cpustat->idle, cputime64); } @@ -7065,7 +7050,7 @@ void sched_show_task(struct task_struct unsigned state; state = p->state ? __ffs(p->state) + 1 : 0; - printk(KERN_INFO "%-15.15s %c", p->comm, + printk(KERN_INFO "%-13.13s %c", p->comm, state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?'); #if BITS_PER_LONG == 32 if (state == TASK_RUNNING) @@ -9773,24 +9758,13 @@ static inline int preempt_count_equals(i return (nested == PREEMPT_INATOMIC_BASE + preempt_offset); } -static int __might_sleep_init_called; -int __init __might_sleep_init(void) -{ - __might_sleep_init_called = 1; - return 0; -} -early_initcall(__might_sleep_init); - void __might_sleep(char *file, int line, int preempt_offset) { #ifdef in_atomic static unsigned long prev_jiffy; /* ratelimiting */ if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) || - oops_in_progress) - return; - if (system_state != SYSTEM_RUNNING && - (!__might_sleep_init_called || system_state != SYSTEM_BOOTING)) + system_state != SYSTEM_RUNNING || oops_in_progress) return; if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) return; @@ -10615,15 +10589,6 @@ cpu_cgroup_destroy(struct cgroup_subsys static int cpu_cgroup_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk) { - if ((current != tsk) && (!capable(CAP_SYS_NICE))) { - const struct cred *cred = current_cred(), *tcred; - - tcred = __task_cred(tsk); - - if (cred->euid != tcred->uid && cred->euid != tcred->suid) - return -EPERM; - } - #ifdef CONFIG_RT_GROUP_SCHED if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk)) return -EINVAL;