Re: [PATCH RFC v4 2/3] sched: Avoid placing RT threads on cores handling long softirqs
From: Alexander Gordeev
Date: Wed Oct 19 2022 - 06:16:31 EST
On Mon, Oct 17, 2022 at 08:42:53PM -0700, John Stultz wrote:
> Hrm. Suggestions? As select_task_rq_rt() is only one of the callers.
> Trying to pass curr into cpu_busy_with_softirqs() would mean
> cpupri_find_fitness() would need to read the cpu_rq(cpu)->curr for the
> specified cpu and pass that in.
May be you could have a lightweight checker that accepts rq and curr
and gets called from select_task_rq_rt(). Then you could call that
same checker from cpu_busy_with_softirqs().
> Just to expand what it should be in detail:
> 1: (softirqs & LONG_SOFTIRQ_MASK) &&
> 2: (curr == cpu_ksoftirqd ||
> 3: task_thread_info(curr)->preempt_count & SOFTIRQ_MASK)
>
> Where we're checking
> 1) that the active_softirqs and __cpu_softirq_pending() values on the
> target cpu are running a long softirq.
> AND (
> 2) The current task on the target cpu is ksoftirqd
> OR
> 3) The preempt_count of the current task on the target cpu has SOFTIRQ entries
> )
2) When the target CPU is handling or about to handle long softirqs
already what is the difference if it is also running ksoftirqd or not?
3) What is the point of this check when 1) is true already?
Thanks!