Page MenuHomeFreeBSD

sys/intr: switch to index vars from table size vars
Needs ReviewPublic

Authored by ehem_freebsd_m5p.com on Jan 19 2023, 3:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 4:45 AM
Unknown Object (File)
Wed, Apr 10, 12:30 AM
Unknown Object (File)
Wed, Apr 3, 1:11 AM
Unknown Object (File)
Sat, Mar 30, 6:29 PM
Unknown Object (File)
Sat, Mar 30, 4:58 PM
Unknown Object (File)
Mar 3 2024, 7:38 AM
Unknown Object (File)
Feb 11 2024, 9:37 AM
Unknown Object (File)
Dec 22 2023, 5:32 AM
Subscribers

Details

Reviewers
markj
mmel
Summary

Since all interrupt table implementations use the same index variable to
indicate current table size, use that instead of size variables.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 49868
Build 46759: arc lint + arc unit

Event Timeline

This seems reasonable to me overall.

sys/kern/kern_intr.c
1659 ↗(On Diff #115288)

Shouldn't "MAXCOMLEN+1" be INTRNAME_LEN or so?

1715 ↗(On Diff #115288)

Before we were iterating over the entire table, now we're iterating up to the last allocated index. Do we still need this check?

ehem_freebsd_m5p.com added inline comments.
sys/kern/kern_intr.c
1659 ↗(On Diff #115288)

Unfortunately, INTRNAME_LEN is INTRNG-only whereas this is shared by the distinct architectural interrupt subsystems. As a result MAXCOM + 1 must be used. This is also why D38116 depends upon D38115 (without D38115 the entry lengths vary by architecture and this doesn't work).

1715 ↗(On Diff #115288)

I agree, I'll adjust this.

ehem_freebsd_m5p.com marked 2 inline comments as done.

Update db_show_intrcnt() rather more than suggested, fully adjust to match how all architectures have been handling intrnames for some time.

Testing identified trouble with watchdog_fire(), do similar work there.

sys/kern/kern_intr.c
1659 ↗(On Diff #115288)

I should add. I could do a second commit (which may or may not work as part of D38116) which moves INTRNAME_LEN from sys/sys/intr.h to sys/sys/interrupt.h and modifies sys/powerpc/powerpc/intr_machdep.c/sys/x86/x86/intr_machdep.c to use that instead of MAXCOMLEN + 1.

If that was done then it would be appropriate to use INTRNAME_LEN instead and I would do so.

Update in light of D38116. The impact was interesting to figure out.