From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b49Mu-0002OV-DO for qemu-devel@nongnu.org; Sat, 21 May 2016 12:03:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b49Mq-0005TQ-78 for qemu-devel@nongnu.org; Sat, 21 May 2016 12:03:11 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b49Mp-0005TJ-WB for qemu-devel@nongnu.org; Sat, 21 May 2016 12:03:08 -0400 Received: by mail-wm0-x242.google.com with SMTP id n129so4183919wmn.1 for ; Sat, 21 May 2016 09:03:07 -0700 (PDT) Sender: Paolo Bonzini References: <1463787632-7241-1-git-send-email-stefanha@redhat.com> <1463787632-7241-6-git-send-email-stefanha@redhat.com> From: Paolo Bonzini Message-ID: Date: Sat, 21 May 2016 18:02:52 +0200 MIME-Version: 1.0 In-Reply-To: <1463787632-7241-6-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 5/9] virtio-blk: multiqueue batch notify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , Ming Lei , Fam Zheng On 21/05/2016 01:40, Stefan Hajnoczi wrote: > + while ((i = find_next_bit(s->batch_notify_vqs, nvqs, i)) < nvqs) { > + VirtQueue *vq = virtio_get_queue(vdev, i); > + > + bitmap_clear(s->batch_notify_vqs, i, 1); clear_bit? > + if (s->dataplane_started && !s->dataplane_disabled) { > + virtio_blk_data_plane_notify(s->dataplane, vq); > + } else { > + virtio_notify(vdev, vq); > + } The find_next_bit loop is not very efficient and could use something similar to commit 41074f3 ("omap_intc: convert ffs(3) to ctz32() in omap_inth_sir_update()", 2015-04-28). But it can be improved later. Thanks, Paolo