Date: Thu, 8 Jul 2021 06:44:56 GMT From: Michal Meloun <mmel@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: a49f208d94b8 - main - intrng: Releasing interrupt source should clear interrupt table full state. Message-ID: <202107080644.1686iu9c002781@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=a49f208d94b873b2187adbfe1d785b3bc8bdc598 commit a49f208d94b873b2187adbfe1d785b3bc8bdc598 Author: Michal Meloun <mmel@FreeBSD.org> AuthorDate: 2021-07-02 18:17:36 +0000 Commit: Michal Meloun <mmel@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_freebsd@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107080644.1686iu9c002781>