--- zzzz-none-000/linux-5.15.111/kernel/sched/core.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/kernel/sched/core.c 2024-02-07 10:23:29.000000000 +0000 @@ -27,6 +27,8 @@ #include "pelt.h" #include "smp.h" +#include + /* * Export tracepoints that act as a bare tracehook (ie: have no trace event * associated with them) to allow external modules to probe them. @@ -4891,6 +4893,7 @@ * transition, resulting in a double drop. */ prev_state = READ_ONCE(prev->__state); + avm_simple_profiling_sched(); vtime_task_switch(prev); perf_event_task_sched_in(prev, current); finish_task(prev); @@ -5551,6 +5554,12 @@ if (oops_in_progress) return; + if (IS_ENABLED(CONFIG_AVM_PRINTK)) { + console_verbose(); + if (IS_ENABLED(CONFIG_PRINTK)) + printk_avm_console_bend(0); /* force serial-output */ + } + printk(KERN_ERR "BUG: scheduling while atomic: %s/%d/0x%08x\n", prev->comm, prev->pid, preempt_count()); @@ -5567,6 +5576,14 @@ dump_stack(); add_taint(TAINT_WARN, LOCKDEP_STILL_OK); + + if (IS_ENABLED(CONFIG_AVM_ENHANCED)) { + if (IS_ENABLED(CONFIG_SMP)) + BUG(); + else + panic("BUG: scheduling while atomic: %s/%d/0x%08x\n", + prev->comm, prev->pid, preempt_count()); + } } /* @@ -9592,8 +9609,7 @@ if ((preempt_count_equals(preempt_offset) && !irqs_disabled() && !is_idle_task(current) && !current->non_block_count) || - system_state == SYSTEM_BOOTING || system_state > SYSTEM_RUNNING || - oops_in_progress) + system_state == SYSTEM_BOOTING || system_state > SYSTEM_RUNNING) return; if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)