--- zzzz-none-000/linux-5.15.111/kernel/softirq.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-arm-6670-761/linux-5.15.111/kernel/softirq.c 2024-02-07 09:28:08.000000000 +0000 @@ -6,6 +6,10 @@ * * Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903) */ +/* + * Includes Intel Corporation's changes/modifications dated: 2019. + * Changed/modified portions - Copyright (c) 2019, Intel Corporation. + */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -30,6 +34,8 @@ #include +#include + #define CREATE_TRACE_POINTS #include @@ -80,6 +86,7 @@ wake_up_process(tsk); } +#if 0 /* * If ksoftirqd is scheduled, we do not want to process pending softirqs * right now. Let ksoftirqd handle this at its own rate, to get fairness, @@ -94,6 +101,7 @@ return false; return tsk && task_is_running(tsk) && !__kthread_should_park(tsk); } +#endif #ifdef CONFIG_TRACE_IRQFLAGS DEFINE_PER_CPU(int, hardirqs_enabled); @@ -419,9 +427,6 @@ static inline void invoke_softirq(void) { - if (ksoftirqd_running(local_softirq_pending())) - return; - if (!force_irqthreads() || !__this_cpu_read(ksoftirqd)) { #ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK /* @@ -455,7 +460,7 @@ pending = local_softirq_pending(); - if (pending && !ksoftirqd_running(pending)) + if (pending) do_softirq_own_stack(); local_irq_restore(flags); @@ -555,7 +560,9 @@ kstat_incr_softirqs_this_cpu(vec_nr); trace_softirq_entry(vec_nr); + avm_simple_profiling_log(avm_profile_data_type_sw_irq_begin, (unsigned int)(h->action), (unsigned int)h); h->action(h); + avm_simple_profiling_log(avm_profile_data_type_sw_irq_end, (unsigned int)(h->action), (unsigned int)h); trace_softirq_exit(vec_nr); if (unlikely(prev_count != preempt_count())) { pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n", @@ -779,10 +786,23 @@ if (tasklet_trylock(t)) { if (!atomic_read(&t->count)) { if (tasklet_clear_sched(t)) { - if (t->use_callback) + if (t->use_callback) { + avm_simple_profiling_log(avm_profile_data_type_tasklet_begin, + (unsigned int)(t->callback), + (unsigned int)(t->data)); t->callback(t); - else + avm_simple_profiling_log(avm_profile_data_type_tasklet_end, + (unsigned int)(t->callback), + (unsigned int)(t->data)); + } else { + avm_simple_profiling_log(avm_profile_data_type_tasklet_begin, + (unsigned int)(t->func), + (unsigned int)(t->data)); t->func(t->data); + avm_simple_profiling_log(avm_profile_data_type_tasklet_end, + (unsigned int)(t->func), + (unsigned int)(t->data)); + } } tasklet_unlock(t); continue;