From: "Jan Beulich" Subject: Re: [for-xen-4.5 PATCH v2 2/2] dpci: Add ZOMBIE state to allow the softirq to finish with the dpci_pirq. Date: Thu, 20 Nov 2014 11:55:43 +0100 Message-ID: <546DD6BF0200007800049471@smtp.nue.novell.com> References: <1416435695-23784-1-git-send-email-konrad.wilk@oracle.com> <1416435695-23784-3-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XrPOq-0001Fn-BZ for xen-devel@lists.xenproject.org; Thu, 20 Nov 2014 10:55:44 +0000 In-Reply-To: <1416435695-23784-3-git-send-email-konrad.wilk@oracle.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: andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org, linux@eikelenboom.it List-Id: xen-devel@lists.xenproject.org >>> On 19.11.14 at 23:21, wrote: Leaving aside the question of whether this is the right approach, in case it is a couple of comments: > @@ -85,7 +91,7 @@ static void raise_softirq_for(struct hvm_pirq_dpci *pirq_dpci) > */ > bool_t pt_pirq_softirq_active(struct hvm_pirq_dpci *pirq_dpci) > { > - if ( pirq_dpci->state & ((1 << STATE_RUN) | (1 << STATE_SCHED)) ) > + if ( pirq_dpci->state & ((1 << STATE_RUN) | (1 << STATE_SCHED) | (1 << STATE_ZOMBIE) ) ) This is becoming unwieldy - perhaps better just "if ( pirq_dpci->state )"? > @@ -122,6 +128,7 @@ static void pt_pirq_softirq_cancel(struct hvm_pirq_dpci *pirq_dpci, > /* fallthrough. */ > case (1 << STATE_RUN): > case (1 << STATE_RUN) | (1 << STATE_SCHED): > + case (1 << STATE_RUN) | (1 << STATE_SCHED) | (1 << STATE_ZOMBIE): How would we get into this state? Afaict STATE_ZOMBIE can't be set at the same time as STATE_SCHED. > @@ -786,6 +793,7 @@ unlock: > static void dpci_softirq(void) > { > unsigned int cpu = smp_processor_id(); > + unsigned int reset = 0; bool_t (and would better be inside the loop, avoiding the pointless re-init on the last iteration). But taking it as a whole - aren't we now at risk of losing an interrupt instance the guest expects, due to raise_softirq_for() bailing on zombie entries, and dpci_softirq() being the only place where the zombie state gets cleared? Jan