mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
xen/intr: balance dynamic interrupts across available vCPUs
By default Xen binds all event channels to vCPU#0, and FreeBSD only shuffles the interrupt sources once, at the end of the boot process. Since new event channels might be created after this point (because new devices or backends are added), try to automatically shuffle them at creation time. This does not affect VIRQ or IPI event channels, that are already bound to a specific vCPU as requested by the caller. Sponsored by: Citrix Systems R&D
This commit is contained in:
parent
23ca39cf61
commit
f229f35db7
1 changed files with 11 additions and 0 deletions
|
|
@ -425,6 +425,17 @@ xen_intr_bind_isrc(struct xenisrc **isrcp, evtchn_port_t local_port,
|
|||
/* Assign the opaque handler (the event channel port) */
|
||||
*port_handlep = &isrc->xi_port;
|
||||
|
||||
#ifdef SMP
|
||||
if (type == EVTCHN_TYPE_PORT) {
|
||||
/*
|
||||
* By default all interrupts are assigned to vCPU#0
|
||||
* unless specified otherwise, so shuffle them to balance
|
||||
* the interrupt load.
|
||||
*/
|
||||
xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (filter == NULL && handler == NULL) {
|
||||
/*
|
||||
* No filter/handler provided, leave the event channel
|
||||
|
|
|
|||
Loading…
Reference in a new issue