Index: linux-2.6.30-bfs012/fs/proc/base.c =================================================================== --- linux-2.6.30-bfs012.orig/fs/proc/base.c 2009-08-24 16:12:16.604172927 +1000 +++ linux-2.6.30-bfs012/fs/proc/base.c 2009-08-24 16:12:25.935400335 +1000 @@ -264,10 +264,10 @@ goto out_mm; /* Shh! No looking before we're done */ len = mm->arg_end - mm->arg_start; - + if (len > PAGE_SIZE) len = PAGE_SIZE; - + res = access_process_vm(task, mm->arg_start, buffer, len, 0); // If the nul at the end of args has been overwritten, then @@ -369,7 +369,7 @@ static int proc_pid_schedstat(struct task_struct *task, char *buffer) { return sprintf(buffer, "%llu %llu %lu\n", - (unsigned long long)task->se.sum_exec_runtime, + (unsigned long long)task->se_sum_exec_runtime, (unsigned long long)task->sched_info.run_delay, task->sched_info.pcount); } @@ -805,18 +805,18 @@ goto out; ret = 0; - + mm = get_task_mm(task); if (!mm) goto out_free; ret = -EIO; - + if (file->private_data != (void*)((long)current->self_exec_id)) goto out_put; ret = 0; - + while (count > 0) { int this_len, retval; @@ -832,7 +832,7 @@ ret = -EFAULT; break; } - + ret += retval; src += retval; buf += retval; @@ -892,7 +892,7 @@ copied += retval; buf += retval; dst += retval; - count -= retval; + count -= retval; } *ppos = dst; free_page((unsigned long) page); @@ -1980,7 +1980,7 @@ return error; } -static struct dentry *proc_pident_lookup(struct inode *dir, +static struct dentry *proc_pident_lookup(struct inode *dir, struct dentry *dentry, const struct pid_entry *ents, unsigned int nents) Index: linux-2.6.30-bfs012/kernel/sched_bfs.c =================================================================== --- linux-2.6.30-bfs012.orig/kernel/sched_bfs.c 2009-08-24 16:12:16.611173749 +1000 +++ linux-2.6.30-bfs012/kernel/sched_bfs.c 2009-08-24 16:12:25.937424196 +1000 @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -181,21 +182,23 @@ #ifdef CONFIG_SCHEDSTATS /* latency stats */ struct sched_info rq_sched_info; + unsigned long long rq_cpu_time; + /* could above be rq->cfs_rq.exec_clock + rq->rt_rq.rt_runtime ? */ /* sys_sched_yield() stats */ - unsigned long yld_exp_empty; - unsigned long yld_act_empty; - unsigned long yld_both_empty; - unsigned long yld_cnt; + unsigned int yld_count; /* schedule() stats */ - unsigned long sched_switch; - unsigned long sched_cnt; - unsigned long sched_goidle; + unsigned int sched_switch; + unsigned int sched_count; + unsigned int sched_goidle; /* try_to_wake_up() stats */ - unsigned long ttwu_cnt; - unsigned long ttwu_local; + unsigned int ttwu_count; + unsigned int ttwu_local; + + /* BKL stats */ + unsigned int bkl_count; #endif }; @@ -2011,7 +2014,6 @@ dump_stack(); } - schedstat_inc(rq, sched_cnt); now = sched_clock(); grq_lock_irq(); @@ -3187,7 +3189,7 @@ struct task_struct *p = current; grq_lock_irq(); - schedstat_inc(rq, yld_cnt); + schedstat_inc(this_rq(), yld_count); if (!rt_task(p)) p->deadline = jiffies + longest_deadline(); requeue_task(p); @@ -3580,70 +3582,6 @@ EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr); #ifdef CONFIG_HOTPLUG_CPU -/* - * Figure out where task on dead CPU should go, use force if neccessary. - * NOTE: interrupts should be disabled by the caller - */ -static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p) -{ - unsigned long flags; - cpumask_t mask; - struct rq *rq; - int dest_cpu; - -restart: - /* On same node? */ - mask = node_to_cpumask(cpu_to_node(dead_cpu)); - cpus_and(mask, mask, p->cpus_allowed); - dest_cpu = any_online_cpu(mask); - - /* On any allowed CPU? */ - if (dest_cpu == NR_CPUS) - dest_cpu = any_online_cpu(p->cpus_allowed); - - /* No more Mr. Nice Guy. */ - if (dest_cpu == NR_CPUS) { - rq = task_grq_lock(p, &flags); - cpus_setall(p->cpus_allowed); - dest_cpu = any_online_cpu(p->cpus_allowed); - task_grq_unlock(&flags); - - /* - * Don't tell them about moving exiting tasks or - * kernel threads (both mm NULL), since they never - * leave kernel. - */ - if (p->mm && printk_ratelimit()) - printk(KERN_INFO "process %d (%s) no " - "longer affine to cpu%d\n", - p->pid, p->comm, dead_cpu); - } - - /* Can this even happen? */ - if (task_running(p)) { - resched_task(p); - goto restart; - } -} - -/* Run through task list and migrate tasks from the dead cpu. */ -static void migrate_live_tasks(int src_cpu) -{ - struct task_struct *p, *t; - - write_lock_irq(&tasklist_lock); - - do_each_thread(t, p) { - if (p == current) - continue; - - if (task_cpu(p) == src_cpu) - move_task_off_dead_cpu(src_cpu, p); - } while_each_thread(t, p); - - write_unlock_irq(&tasklist_lock); -} - /* Schedules idle task to be the next runnable task on current CPU. * It does so by boosting its priority to highest possible and adding it to * the _front_ of the runqueue. Used by CPU offline code. @@ -3859,6 +3797,22 @@ } #endif +static void set_rq_online(struct rq *rq) +{ + if (!rq->online) { + cpumask_set_cpu(rq->cpu, rq->rd->online); + rq->online = 1; + } +} + +static void set_rq_offline(struct rq *rq) +{ + if (rq->online) { + cpumask_clear_cpu(rq->cpu, rq->rd->online); + rq->online = 0; + } +} + /* * migration_call - callback that gets triggered when a CPU is added. * Here we can start up the necessary migration thread for the new CPU. @@ -3867,6 +3821,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) { int cpu = (long)hcpu; + unsigned long flags; struct rq *rq; switch (action) { @@ -3877,6 +3832,15 @@ case CPU_ONLINE: case CPU_ONLINE_FROZEN: + /* Update our root-domain */ + rq = cpu_rq(cpu); + grq_lock_irqsave(&flags); + if (rq->rd) { + BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); + + set_rq_online(rq); + } + grq_unlock_irqrestore(&flags); break; #ifdef CONFIG_HOTPLUG_CPU @@ -3887,7 +3851,6 @@ case CPU_DEAD: case CPU_DEAD_FROZEN: cpuset_lock(); /* around calls to cpuset_cpus_allowed_lock() */ - migrate_live_tasks(cpu); rq = cpu_rq(cpu); /* Idle task back to normal (off runqueue, low prio) */ grq_lock_irq(); @@ -3918,6 +3881,13 @@ case CPU_DYING: case CPU_DYING_FROZEN: + rq = cpu_rq(cpu); + grq_lock_irqsave(&flags); + if (rq->rd) { + BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); + set_rq_offline(rq); + } + grq_unlock_irqrestore(&flags); break; #endif } @@ -4134,23 +4104,6 @@ kfree(rd); } -/* Fake this shit */ -static void set_rq_online(struct rq *rq) -{ - if (!rq->online) { - cpumask_set_cpu(rq->cpu, rq->rd->online); - rq->online = 1; - } -} - -static void set_rq_offline(struct rq *rq) -{ - if (rq->online) { - cpumask_clear_cpu(rq->cpu, rq->rd->online); - rq->online = 0; - } -} - static void rq_attach_root(struct rq *rq, struct root_domain *rd) { struct root_domain *old_rd = NULL;