On Mon, Jun 21, 2021 at 02:04:30PM +0000, Visa Hankala wrote:
> On Thu, May 27, 2021 at 07:40:26PM -0500, Scott Cheloha wrote:
> > On Sun, May 23, 2021 at 09:05:24AM +0000, Visa Hankala wrote:
> > > When a CPU starts processing a soft interrupt, it reserves the handler
> > > to prevent concurrent execution. If the soft interrupt gets rescheduled
> > > during processing, the handler is run again by the same CPU. This breaks
> > > FIFO ordering, though.
> > 
> > If you want to preserve FIFO you can reinsert the handler at the queue
> > tail.  That would be more fair.
> > 
> > If FIFO is the current behavior I think we ought to keep it.
> 
> I have updated the patch to preserve the FIFO order.
> 
> > > +STAILQ_HEAD(x86_soft_intr_queue, x86_soft_intrhand);
> > > +
> > > +struct x86_soft_intr_queue softintr_queue[X86_NSOFTINTR];
> > 
> > Why did we switch to STAILQ?  I know we don't have very many
> > softintr_disestablish() calls but isn't O(1) removal worth the extra
> > pointer?
> 
> I used STAILQ because it avoids the hassle of updating the list nodes'
> back pointers. softintr_disestablish() with multiple items pending in
> the queue is very rare in comparison to the normal softintr_schedule() /
> softintr_dispatch() cycle.
> 
> However, I have changed the code back to using TAILQ.

This looks good to me.  I mean, it looked good before, but it still
looks good.

I will run with it for a few days.

Assuming I hit no issues I'll come back with an OK.

Is there an easy way to exercise this code from userspace?  There
aren't many softintr users.

Maybe audio drivers?

Reply via email to