4.4-rt ... seems to have same ireqwork problem was Re: 4.19.106-rt44 -- boot problems with irqwork: push most work into softirq context

From: Pavel Machek
Date: Sun Mar 29 2020 - 06:09:20 EST


Hi!

> > > > > Does this patch help?
> > > >
> > > > I don't think so. It also failed, and the failure seems to be
> > > > identical to me.
> > > >
> > > > https://gitlab.com/cip-project/cip-kernel/linux-cip/tree/ci/pavel/linux-cip
> > > > https://lava.ciplatform.org/scheduler/job/13110
> > > >
> > >
> > > Can you send me a patch that shows the difference between the revert that
> > > you say works, and the upstream v4.19-rt tree (let me know which version
> > > of v4.19-rt you are basing it on).
> >
> > I was using -rt44, and yes, I can probably generate better diffs.
> >
> > But I guess I found it with code review: how does this look to you? I
> > applied it on top of your fix, and am testing. 2 successes so far.
>
> And I'd recommend some kind of cleanup on top. The code is really
> "interesting" and we don't want to have two copies. Totally untested.
>
> Looking at the code, it could be probably cleaned up further.

It seems 4.4 branch has same problem. Unfortunately, our testing lab
does not help in this case, so .. this is completely untested. Problem
was found by code inspection.

Best regards,
Pavel

Signed-off-by: Pavel Machek <pavel@xxxxxxx>
Fixes: fc9f4631a290 ("irqwork: push most work into softirq context")

diff --git a/kernel/irq_work.c b/kernel/irq_work.c
index 2899ba0d23d1..19896e6f1b2a 100644
--- a/kernel/irq_work.c
+++ b/kernel/irq_work.c
@@ -78,7 +78,8 @@ bool irq_work_queue_on(struct irq_work *work, int cpu)
if (!irq_work_claim(work))
return false;

- if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !(work->flags & IRQ_WORK_HARD_IRQ))
+ if ((IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !(work->flags & IRQ_WORK_HARD_IRQ))
+ || (work->flags & IRQ_WORK_LAZY))
list = &per_cpu(lazy_list, cpu);
else
list = &per_cpu(raised_list, cpu);



--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Attachment: signature.asc
Description: PGP signature