On Thu, 2018-01-18 at 17:53 +0000, Dmitry Safonov wrote:
> How do you identify in RT one ksoftirqd thread from
> another? I mean, to find which softirq nr the thread is servicing?

static void do_raise_softirq_irqoff(unsigned int nr)
{
        struct task_struct *tsk = __this_cpu_ksoftirqd(nr);
        unsigned int mask = 1UL << nr;

        trace_softirq_raise(nr);
        or_softirq_pending(mask);

        /*
         * If we are not in a hard interrupt and inside a bh disabled
         * region, we simply raise the flag on current. local_bh_enable()
         * will make sure that the softirq is executed. Otherwise we
         * delegate it to the proper softirqd thread for this softirq.
         */
        if (!in_irq() && current->softirq_nestcnt) {
                if (!(current->flags & PF_KSOFTIRQD) || current == tsk)
                        current->softirqs_raised |= mask;
                else if (tsk) {
                        tsk->softirqs_raised |= mask;
                        wakeup_softirqd(nr);
                }
        } else if (tsk)
                tsk->softirqs_raised |= mask;
}

Reply via email to