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)
Thu, Oct 24, 11:40 PM
Unknown Object (File)
Oct 3 2024, 3:32 PM
Unknown Object (File)
Oct 3 2024, 12:58 PM
Unknown Object (File)
Oct 1 2024, 8:05 PM
Unknown Object (File)
Oct 1 2024, 4:58 PM
Unknown Object (File)
Sep 29 2024, 3:56 AM
Unknown Object (File)
Sep 26 2024, 8:29 PM
Unknown Object (File)
Sep 14 2024, 8:04 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 49176
Build 46065: arc lint + arc unit

Event Timeline

This seems reasonable to me overall.

sys/kern/kern_intr.c
1648

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

1694–1695

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
1648

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).

1694–1695

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
1648

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.