Re: [RFC PATCH v2 3/4] irq: Introduce IRQ_HANDLED_MANY

From: Leonardo Bras
Date: Thu Feb 22 2024 - 23:53:19 EST


On Wed, Feb 21, 2024 at 06:04:21PM +0100, Thomas Gleixner wrote:
> On Wed, Feb 21 2024 at 16:41, Thomas Gleixner wrote:
> > On Wed, Feb 21 2024 at 02:39, Leonardo Bras wrote:
> > But as I pointed out above the detection logic is flawed due to the
> > unconditional accumulation. Can you give the uncompiled below a test
> > ride with your scenario?
>
> Bah. Ignore this. I misread the code completely. No idea where my brain
> was.
>
> This thing triggers only when there are 100K interrupts and 99.9k of
> them unhandled. The 100k total resets the unhandled counts.
>
> Though one thing which strikes me odd is that this actually triggers at
> all because it needs 99.9k unhandled out of 100k total. That means on
> average every thread handler invocation handles 1000 hardware interrupts
> in one go. Is that even realistic?

Yeap, it triggers pretty easily if you bring a vm with a serial console,
and try to use it to work with something very verbose.

It was detected by someone trying to unpack a kernel source tarball.

Maybe this is an issue that only becomes reproducible for this and maybe a
couple extra drivers, so the solution will only need to be implemented in
those drivers when (if) this bug reproduces.

This being said, thank you for helping me improve my understandig of this
piece of code. I will put some effort in trying to find a solution that
works by changing generic-code only, but would like to understand if the
current proposal is valid if I am unable to find any.

Thanks!
Leo


>
> Thanks,
>
> tglx
>
>