From: "Jan Beulich" Subject: Re: [RFC PATCH v1] Replace tasklets with per-cpu implementation. Date: Wed, 10 Sep 2014 17:25:33 +0100 Message-ID: <5410979D0200007800033781@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> <540F48F50200007800032D98@mail.emea.novell.com> <20140910160335.GI12893@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 1XRki9-0005O6-9W for xen-devel@lists.xenproject.org; Wed, 10 Sep 2014 16:25:37 +0000 In-Reply-To: <20140910160335.GI12893@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 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. 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(). But apart from that it all looks quite good now. Does it also do what we hope it would? Jan