The branch main has been updated by mmel:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a49f208d94b873b2187adbfe1d785b3bc8bdc598

commit a49f208d94b873b2187adbfe1d785b3bc8bdc598
Author:     Michal Meloun <m...@freebsd.org>
AuthorDate: 2021-07-02 18:17:36 +0000
Commit:     Michal Meloun <m...@freebsd.org>
CommitDate: 2021-07-08 06:16:46 +0000

    intrng: Releasing interrupt source should clear interrupt table full state.
    
    The first release of an interrupt in a situation where the interrupt table
    is full should schedule a full table check the next time an interrupt is
    allocated. A full check is necessary to ensure maximum separation between
    the order of allocation and the order of release.
    
    Submitted by:   ehem_free...@m5p.com (initial version)
    Discussed in:   https://reviews.freebsd.org/D29310
    MFC after:      4 weeks
---
 sys/kern/subr_intr.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
index df6bf9e63ba0..d4926b2e2364 100644
--- a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -447,6 +447,16 @@ isrc_free_irq(struct intr_irqsrc *isrc)
 
        irq_sources[isrc->isrc_irq] = NULL;
        isrc->isrc_irq = INTR_IRQ_INVALID;      /* just to be safe */
+
+       /*
+        * If we are recovering from the state irq_sources table is full,
+        * then the following allocation should check the entire table. This
+        * will ensure maximum separation of allocation order from release
+        * order.
+        */
+       if (irq_next_free >= intr_nirq)
+               irq_next_free = 0;
+
        return (0);
 }
 
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to