Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751508AbdFFTnH (ORCPT ); Tue, 6 Jun 2017 15:43:07 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:36167 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbdFFTlu (ORCPT ); Tue, 6 Jun 2017 15:41:50 -0400 Subject: Re: [PATCH V2] xen-evtchn: Bind dyn evtchn:qemu-dm interrupt to next online VCPU To: Anoob Soman , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org References: <1496746648-25300-1-git-send-email-anoob.soman@citrix.com> Cc: jgross@suse.com From: Boris Ostrovsky Message-ID: <91bfac47-7258-cec0-2a61-29f2b2e5454b@oracle.com> Date: Tue, 6 Jun 2017 15:41:34 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1496746648-25300-1-git-send-email-anoob.soman@citrix.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1206 Lines: 47 > > /* Rebind an evtchn so that it gets delivered to a specific cpu */ > -static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) > +int xen_rebind_evtchn_to_cpu(int evtchn, unsigned tcpu) > { > struct evtchn_bind_vcpu bind_vcpu; > - int evtchn = evtchn_from_irq(irq); > int masked; > > if (!VALID_EVTCHN(evtchn)) > @@ -1338,6 +1337,12 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) > > return 0; > } > +EXPORT_SYMBOL_GPL(xen_rebind_evtchn_to_cpu); > + > +static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) > +{ > + return xen_rebind_evtchn_to_cpu(evtchn_from_irq(irq), tcpu); > +} There is a single call site for rebind_irq_to_cpu() so why not call xen_rebind_evtchn_to_cpu() directly? > > +static void evtchn_bind_interdom_next_vcpu(int evtchn) > +{ > + static DEFINE_PER_CPU(int, bind_last_selected_cpu); > + unsigned int selected_cpu, irq; > + struct irq_desc *desc; > + unsigned long flags; > + > + irq = irq_from_evtchn(evtchn); > + desc = irq_to_desc(irq); > + > + if (!desc) > + return; > + > + raw_spin_lock_irqsave(&desc->lock, flags); Is there a reason why you are using raw_ version? (Sorry, I should have noticed both of these earlier) -boris