From: "Jan Beulich" Subject: Re: [RFC PATCH v1] Replace tasklets with per-cpu implementation. Date: Tue, 09 Sep 2014 17:37:41 +0100 Message-ID: <540F48F50200007800032D98@mail.emea.novell.com> References: <1409162329-6094-1-git-send-email-konrad.wilk@oracle.com> <53FF3F3A020000780002EB62@mail.emea.novell.com> <20140829134649.GC3609@laptop.dumpdata.com> <5400A5EB020000780002F118@mail.emea.novell.com> <20140902202834.GC16610@laptop.dumpdata.com> <5406E7810200007800030136@mail.emea.novell.com> <20140908190141.GA10401@laptop.dumpdata.com> <540EDDF502000078000326BB@mail.emea.novell.com> <20140909143709.GI5435@laptop.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XROQL-0005Jo-Kj for xen-devel@lists.xenproject.org; Tue, 09 Sep 2014 16:37:45 +0000 In-Reply-To: <20140909143709.GI5435@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: xen-devel@lists.xenproject.org, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 09.09.14 at 16:37, wrote: > On Tue, Sep 09, 2014 at 10:01:09AM +0100, Jan Beulich wrote: >> >>> On 08.09.14 at 21:01, wrote: >> > +static int cpu_callback( >> > + struct notifier_block *nfb, unsigned long action, void *hcpu) >> > +{ >> > + unsigned int cpu = (unsigned long)hcpu; >> > + >> > + switch ( action ) >> > + { >> > + case CPU_UP_PREPARE: >> > + INIT_LIST_HEAD(&per_cpu(dpci_list, cpu)); >> > + break; >> > + case CPU_UP_CANCELED: >> > + case CPU_DEAD: >> > + migrate_tasklets_from_cpu(cpu, (&per_cpu(dpci_list, cpu))); >> >> Can CPUs go down while softirqs are pending on them? > > No. By the time we get here, the CPU is no longer "hearing" them. So what's that code (also still present in the newer patch you had attached here) for then? > +void dpci_kill(struct domain *d) > +{ > + while ( test_and_set_bit(STATE_SCHED, &d->state) ) > + { > + do { > + process_pending_softirqs(); > + } while ( test_bit(STATE_SCHED, &d->state) ); > + } > + > + while ( test_bit(STATE_RUN, &d->state) ) > + { > + cpu_relax(); > + } > + clear_bit(STATE_SCHED, &d->state); Does all this perhaps need preemption handling? The caller (pci_release_devices()) is direct descendant from domain_relinquish_resources(), so even bubbling -EAGAIN or -ERESTART back up instead of spinning would seem like an option. Jan