Re: [PATCH v3] kcov: move kcov_remote_data to task_struct for RT and remove local_lock
From: Sebastian Andrzej Siewior
Date: Thu May 21 2026 - 14:15:06 EST
On 2026-05-22 00:28:26 [+0900], Tetsuo Handa wrote:
> > If handling softirqs in parallel might be indeed a reasonable solution.
> > You would need to use the per-task area instead per-CPU for this in the
> > softirq case on PREEMPT_RT. But the other checks, such as in_task()
> > work as intended on both.
>
> https://share.google/aimode/PveuuU5od6d1lAwit (expires in 7 days) says
>
> Non-PREEMPT_RT Kernel: in_task() returns false while executing a softirq.
>
> PREEMPT_RT Kernel: in_task() returns true while executing a softirq (unless
> nested inside a hard interrupt or NMI).
>
> Is this explanation wrong?
Yes. If a softirq is executed (in_serving_softirq() returns true) then
in_task() returns false. On PREEMPT_RT and on non-PREEMPT_RT kernels. It
is irrelevant if the softirq is executed at the end of an interrupt
handler and within ksoftirqd.
Sebastian