Page MenuHomeFreeBSD

make maximum interrupt number tunable on ARM, ARM64, MIPS, and RISC-V
ClosedPublic

Authored by gonzo on Dec 30 2020, 7:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 18, 6:11 AM
Unknown Object (File)
Oct 10 2024, 4:13 AM
Unknown Object (File)
Oct 7 2024, 9:31 AM
Unknown Object (File)
Oct 7 2024, 9:30 AM
Unknown Object (File)
Oct 7 2024, 9:30 AM
Unknown Object (File)
Oct 7 2024, 9:28 AM
Unknown Object (File)
Oct 7 2024, 9:05 AM
Unknown Object (File)
Oct 4 2024, 9:50 PM

Details

Summary

Use a machdep.nirq tunable intead of compile-time constant NIRQ
as a value for maximum number of interrupts. It allows keep a system
footprint small by default with an option to increase the limit
for large systems like server-grade ARM64

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

gonzo requested review of this revision.Dec 30 2020, 7:02 AM
sys/kern/subr_intr.c
145–146

Since we are now sizing this dynamically, it would make more sense to do it based on mp_ncpus. You might also drop this constant and just inline it in intr_irq_init(), since it is not used elsewhere.

150

machdep_ is an unusual prefix for a variable --- I don't think anything else is named that way. Maybe intr_nirq if not just nirq?

408

Is there a reason to use irq_sources_count rather than just machdep_nirq?

1731

Could push M_WAITOK to the next line if it becomes too long.

gonzo added inline comments.
sys/kern/subr_intr.c
145–146

Fixed the constant. I'd like to leave mp_ncpus for another round of changes.

150

Fixed

408

Just an automatic renaming. Fixed.

gonzo marked 3 inline comments as done.
  • Address mhorne's comments

A couple of small nitpicks, otherwise LGTM.

sys/kern/subr_intr.c
185

You can drop the extra newline.

408

Thanks, but it looks like irq_sources_count can be dropped altogether in favor of machdep_nirq.

This revision is now accepted and ready to land.Jan 13 2021, 8:04 PM

This is rather a bit overdue, but I note D27844 has a troublesome interaction with D16861. At fd036deac169, vmstat was modified to look for nintrcnt to distinguish kernel core dumps in which intrcnt/intrnames were arrays versus pointers. As a result right now if an ARM[64]/RISC-V kernel core dump was analyzed using vmstat the interrupt counts will be misinterpreted since it will expect an array instead of a pointer.

I had been pondering renaming intrcnt_count to nintrcnt as part of D38305, but had decided that was unnecessary. Yet now noticing this concern I'm wonder whether I should bring that back due to this issue.