Date: Thu, 11 Dec 2014 09:15:39 +0100 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <royger@FreeBSD.org> To: "Justin T. Gibbs" <gibbs@scsiguy.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r275679 - head/sys/x86/xen Message-ID: <548952AB.7060804@FreeBSD.org> In-Reply-To: <BC85A0F1-E83F-4CB3-B026-7C15203C7AB1@scsiguy.com> References: <201412101325.sBADPMgZ081973@svn.freebsd.org> <BC85A0F1-E83F-4CB3-B026-7C15203C7AB1@scsiguy.com>
next in thread | previous in thread | raw e-mail | index | archive | help
El 10/12/14 a les 21.17, Justin T. Gibbs ha escrit: > On Dec 10, 2014, at 6:25 AM, Roger Pau MonnXX <royger@FreeBSD.org> wrote: >> >> Author: royger >> Date: Wed Dec 10 13:25:21 2014 >> New Revision: 275679 >> URL: https://svnweb.freebsd.org/changeset/base/275679 >> >> Log: >> 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 >> >> Modified: >> head/sys/x86/xen/xen_intr.c >> >> Modified: head/sys/x86/xen/xen_intr.c >> ============================================================================== >> --- head/sys/x86/xen/xen_intr.c Wed Dec 10 11:42:02 2014 (r275678) >> +++ head/sys/x86/xen/xen_intr.c Wed Dec 10 13:25:21 2014 (r275679) >> @@ -425,6 +425,17 @@ xen_intr_bind_isrc(struct xenisrc **isrc >> /* 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 >> + > > Shouldn't this only happen for new interrupt source objects, not those that are being reclaimed/reused? No, because the vCPU binding is done based on the event channel port, which changes when the event channel is allocated/setup. What I realize now is that I should probably have used intr_event_bind instead of directly calling xen_intr_assign_cpu, so that the ithread cpu mask is also correctly set. Roger.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?548952AB.7060804>