From: "Jan Beulich" Subject: Re: [PATCH v8 for-xen-4.5 2/2] dpci: Replace tasklet with an softirq (v8) Date: Tue, 28 Oct 2014 10:43:32 +0000 Message-ID: <544F81640200007800042BE5@mail.emea.novell.com> References: <544A41970200007800041D63@mail.emea.novell.com> <20141024205544.GA19814@laptop.dumpdata.com> <544E1F590200007800042517@mail.emea.novell.com> <544E2105.1000907@citrix.com> <544E33B902000078000425F0@mail.emea.novell.com> <544E27D6.1040305@citrix.com> <544E397F0200007800042651@mail.emea.novell.com> <20141027170115.GC11893@laptop.dumpdata.com> <544E8283.1030907@citrix.com> <20141027180010.GB12989@laptop.dumpdata.com> <20141027211338.GA17750@laptop.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xj4FT-0002Jw-Jf for xen-devel@lists.xenproject.org; Tue, 28 Oct 2014 10:43:35 +0000 In-Reply-To: <20141027211338.GA17750@laptop.dumpdata.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: keir@xen.org, ian.campbell@citrix.com, Andrew Cooper , tim@xen.org, xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 27.10.14 at 22:13, wrote: > + /* > + * A crude 'while' loop with us dropping the spinlock and giving > + * the softirq_dpci a chance to run. > + * We MUST check for this condition as the softirq could be scheduled > + * and hasn't run yet. Note that this code replaced tasklet_kill which > + * would have spun forever and would do the same thing (wait to flush out > + * outstanding hvm_dirq_assist calls. > + */ > + if ( pt_pirq_softirq_active(pirq_dpci) ) > + { > + spin_unlock(&d->event_lock); > + if ( pirq_dpci->cpu >= 0 && pirq_dpci->cpu != smp_processor_id() ) > + { > + /* > + * The 'raise_softirq_for' sets the CPU and raises the softirq bit > + * so we do not need to set the target CPU's HVM_DPCI_SOFTIRQ. > + */ > + smp_send_event_check_cpu(pirq_dpci->cpu); > + pirq_dpci->cpu = -1; > + } > + cpu_relax(); > + goto restart; > + } As said in an earlier reply to Andrew, I think this open coding goes too far. And with the softirq known to have got sent, I also don't really see why it needs to be resent _at all_ (and the comments don't explain this either). Jan