From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9wGg-0008Vg-8X for qemu-devel@nongnu.org; Mon, 06 Jun 2016 11:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9wGd-0006sq-IJ for qemu-devel@nongnu.org; Mon, 06 Jun 2016 11:16:42 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:32890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9wGd-0006sh-Ay for qemu-devel@nongnu.org; Mon, 06 Jun 2016 11:16:39 -0400 Received: by mail-wm0-x241.google.com with SMTP id c74so9081660wme.0 for ; Mon, 06 Jun 2016 08:16:39 -0700 (PDT) Sender: Paolo Bonzini References: <1464657966-26186-1-git-send-email-stefanha@redhat.com> <20160603001941.GA12907@stefanha-x1.localdomain> <20160603222627.GA2609@stefanha-x1.localdomain> From: Paolo Bonzini Message-ID: Date: Mon, 6 Jun 2016 17:16:33 +0200 MIME-Version: 1.0 In-Reply-To: <20160603222627.GA2609@stefanha-x1.localdomain> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/8] virtio-blk: multiqueue support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Ming Lei , Christian Borntraeger , Roman Pen On 04/06/2016 00:26, Stefan Hajnoczi wrote: > It turns out that Patch 1 slows down dataplane even though the code > looks equivalent. After a lot of poking it turned out to be a subtle > issue: > > The order of BHs in the AioContext->first_bh list affects performance. > Linux AIO (block/linux-aio.c) invokes completion callbacks from a BH. > Performance is much better if virtio-blk.c's batch BH is after the > completion BH. > > The "fast" ordering notifies the guest in ~300 nanoseconds after the > last request completion. > > The "slow" ordering sometimes takes 100 microseconds after the last > request completion before the guest is notified. It probably depends on > whether the event loop is kicked by another source. > > I'm thinking of scrapping the batch BH and instead using a notify > plug/unplug callback to suppress notification until the last request has > been processed. > > I also checked that batch notification does indeed improve performance > compared to no batching. It offers a nice boost so we do want to port > the feature from dataplane to non-dataplane. > > For the time being: consider this patch series broken due to the > performance regression. Thanks for the nice analysis! Paolo