--- zzzz-none-000/linux-2.6.32.61/kernel/sched.c 2013-06-10 09:43:48.000000000 +0000 +++ virian-300e-630/linux-2.6.32.61/kernel/sched.c 2014-09-02 09:55:18.000000000 +0000 @@ -71,6 +71,9 @@ #include #include #include +#if defined(CONFIG_AVM_SIMPLE_PROFILING) +#include +#endif/*--- #if defined(CONFIG_AVM_SIMPLE_PROFILING) ---*/ #include #include @@ -2765,9 +2768,9 @@ { unsigned long flags; struct rq *rq; +#ifdef CONFIG_SMP int cpu = get_cpu(); -#ifdef CONFIG_SMP rq = task_rq_lock(p, &flags); p->state = TASK_WAKING; @@ -5597,6 +5600,8 @@ { struct pt_regs *regs = get_irq_regs(); + console_verbose(); + restore_printk(); printk(KERN_ERR "BUG: scheduling while atomic: %s/%d/0x%08x\n", prev->comm, prev->pid, preempt_count()); @@ -5609,6 +5614,12 @@ show_regs(regs); else dump_stack(); +#ifdef CONFIG_SMP + /*--- get information about all cpus ! ---*/ + BUG(); +#else + panic("BUG: scheduling while atomic: %s/%d/0x%08x\n", prev->comm, prev->pid, preempt_count()); +#endif } /* @@ -5746,6 +5757,9 @@ ++*switch_count; context_switch(rq, prev, next); /* unlocks the rq */ +#if defined(CONFIG_AVM_SIMPLE_PROFILING) + avm_simple_profiling_schedule(); +#endif/*--- #if defined(CONFIG_AVM_SIMPLE_PROFILING) ---*/ /* * the context switch might have flipped the stack from under * us, hence refresh the local variables. @@ -9657,7 +9671,7 @@ void __init sched_init(void) { int i, j; - unsigned long alloc_size = 0, ptr; + unsigned long alloc_size = 0, ptr __maybe_unused__; #ifdef CONFIG_FAIR_GROUP_SCHED alloc_size += 2 * nr_cpu_ids * sizeof(void **); @@ -9870,9 +9884,9 @@ "BUG: sleeping function called from invalid context at %s:%d\n", file, line); printk(KERN_ERR - "in_atomic(): %d, irqs_disabled(): %d, pid: %d, name: %s\n", + "in_atomic(): %d, irqs_disabled(): %d, pid: %d, name: %s preempt_count=%d\n", in_atomic(), irqs_disabled(), - current->pid, current->comm); + current->pid, current->comm, preempt_count()); debug_show_held_locks(current); if (irqs_disabled()) @@ -9944,7 +9958,7 @@ #endif /* CONFIG_MAGIC_SYSRQ */ -#ifdef CONFIG_IA64 +#if defined(CONFIG_IA64) || defined(CONFIG_MIPS) /* * These functions are only useful for the IA64 MCA handling. * @@ -9965,7 +9979,9 @@ { return cpu_curr(cpu); } +#endif/*--- #if defined(CONFIG_IA64) || defined(CONFIG_MIPS) ---*/ +#ifdef CONFIG_IA64 /** * set_curr_task - set the current task for a given cpu. * @cpu: the processor in question.