From owner-svn-src-all@FreeBSD.ORG Thu Dec 11 08:15:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 088E886B; Thu, 11 Dec 2014 08:15:51 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 893EE6AD1C; Thu, 11 Dec 2014 08:15:50 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id z12so5716090wgg.1 for ; Thu, 11 Dec 2014 00:15:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=rSm6jTKklD/bYb0TWtrYUMXpxbLUhhwpX/B3824k4Yk=; b=wKuq+YrEqCcfcwDlbf+mKtCXRodSkvljCdGrGZZndyqW0XzxGOyr5nToChO4BONqp0 2zSGitdGwlxNy/CANm1MVXvU0DJFaix2YsfUzZ6qDGexVBqRX9Y0lMf3zgNF0HUFhTn/ 3bnkWio68xM2Ed8EN6/P2Ld5vUhY6mnVSeNamL/tg2i0HDKqDtWcLGAKWqPIEZZ8R/6S 4NEutW15ik/mttXp1izcUzDMMd13yln5wg9fcPQ0lCBncmky2EJ90iGF+OSn+Do6Jkqa 9Xh9Y1oJJ2RhtMBiyeOSxfBfhZk8whhbkFYK4wrPw/Zo+KVV48usLtKhl3dcRVdlj3kJ V0lA== X-Received: by 10.194.71.45 with SMTP id r13mr13773216wju.128.1418285748818; Thu, 11 Dec 2014 00:15:48 -0800 (PST) Received: from [172.16.1.30] (37.Red-2-136-30.dynamicIP.rima-tde.net. [2.136.30.37]) by mx.google.com with ESMTPSA id gy8sm1915117wib.23.2014.12.11.00.15.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Dec 2014 00:15:48 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <548952AB.7060804@FreeBSD.org> Date: Thu, 11 Dec 2014 09:15:39 +0100 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "Justin T. Gibbs" Subject: Re: svn commit: r275679 - head/sys/x86/xen References: <201412101325.sBADPMgZ081973@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2014 08:15:51 -0000 El 10/12/14 a les 21.17, Justin T. Gibbs ha escrit: > On Dec 10, 2014, at 6:25 AM, Roger Pau MonnXX 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.