Page MenuHomeFreeBSD

x86: Scale default msi/msix vector limit with MAXCPU
Needs ReviewPublic

Authored by cem on Jun 12 2020, 9:29 PM.
Tags
None
Referenced Files
F82078262: D25249.diff
Thu, Apr 25, 7:31 AM
Unknown Object (File)
Dec 25 2023, 4:52 PM
Unknown Object (File)
Dec 20 2023, 7:41 AM
Unknown Object (File)
Dec 19 2023, 4:41 PM
Unknown Object (File)
Nov 2 2023, 10:57 PM
Unknown Object (File)
Aug 31 2023, 9:39 PM
Unknown Object (File)
Jul 10 2023, 4:25 AM
Unknown Object (File)
Jun 16 2023, 3:30 AM
Subscribers

Details

Reviewers
jhb
gallatin
kib
Summary

Rather than hardcoding another number, scale the default MSI vector limit with
MAXCPU.

No functional change for amd64 (from 2048 @ r362112). On i386, this reduces
the number of default MSI vectors to 256 (from 512 @ r362111).

Test Plan

This doesn't scale well at the lower limit (especially the extreme case, !SMP),
but I think it is acceptable for current default MAXCPU on x86. (I don't think
SMP && x86 makes much sense as a build configuration anymore; we keep !SMP
mostly for extremely embedded systems like ARM and MIPS.)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31671
Build 29249: arc lint + arc unit

Event Timeline

cem requested review of this revision.Jun 12 2020, 9:29 PM
sys/x86/x86/msi.c
159

I suggest you to either use eg. (MAXCPU + 20) * 8 (20 came just from the air), or 128 + MAXCPU * 8 (128 came from the same source). This should solve UP issues.

People are using VMs with single CPU.

sys/x86/x86/msi.c
159

And maybe use MIN() or the like to enforce at least 512? The theoretical upper limit is something like 200 * MAXCPU (more like 190 or 191 per CPU IIRC). The cost for this value being too high is fairly small (a single array of pointers adds 1 more pointer for each value)s, so erring on the side of too high is probably ok. You could also make this a runtime calculation based off of mp_ncpus if you wanted if you had a default of 0 and then used a SYSINIT to compute the value if it was still zero (if you are truly ambitious). I think scaling with MAXCPU is probably fine though.