From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [RFC PATCH v1] Replace tasklets with per-cpu implementation. Date: Wed, 10 Sep 2014 12:35:49 -0400 Message-ID: <20140910163549.GA16190@laptop.dumpdata.com> References: <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> <540F48F50200007800032D98@mail.emea.novell.com> <20140910160335.GI12893@laptop.dumpdata.com> <5410979D0200007800033781@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XRks9-0006D9-4p for xen-devel@lists.xenproject.org; Wed, 10 Sep 2014 16:35:57 +0000 Content-Disposition: inline In-Reply-To: <5410979D0200007800033781@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel@lists.xenproject.org, keir@xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Sep 10, 2014 at 05:25:33PM +0100, Jan Beulich wrote: > >>> On 10.09.14 at 18:03, wrote: > > +static void dpci_softirq(void) > > +{ > > + > > + struct domain *d; > > + struct list_head *list; > > + struct list_head our_list; > > + > > + local_irq_disable(); > > + list = &__get_cpu_var(dpci_list); > > + > > + INIT_LIST_HEAD(&our_list); > > + list_splice(list, &our_list); > > + > > + INIT_LIST_HEAD(&__get_cpu_var(dpci_list)); > > + > > + local_irq_enable(); > > + > > + while (!list_empty(&our_list)) > > + { > > + d = list_entry(our_list.next, struct domain, list); > > + list_del(&d->list); > > + > > + if ( !test_and_set_bit(STATE_RUN, &(d)->state) ) > > + { > > + if ( !test_and_clear_bit(STATE_SCHED, &d->state) ) > > + BUG(); > > + hvm_dirq_assist((unsigned long)d); > > You surely want to change the parameter type of that function to > no longer need such a cast. Duh! > > Also the parentheses around d (above and below) as well as the > formatting of the while() above will need cleaning up. And the > __get_cpu_var()s want replacing with this_cpu() or per_cpu(). Right. > > But apart from that it all looks quite good now. Does it also do > what we hope it would? Oh yes!. The test results show that this patch and the original (" [RFC PATCH v1 1/5] tasklet: Introduce per-cpu taskle for softirq.", see http://lists.xen.org/archives/html/xen-devel/2014-08/msg02662.html) have the same performance effect - and make a huge improvement with PCI passthrough. > > Jan >