From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buHAQ-0006Cr-59 for qemu-devel@nongnu.org; Wed, 12 Oct 2016 06:53:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buHAO-0004Qi-7G for qemu-devel@nongnu.org; Wed, 12 Oct 2016 06:53:45 -0400 Sender: Paolo Bonzini References: <1476267508-19499-1-git-send-email-xiecl.fnst@cn.fujitsu.com> From: Paolo Bonzini Message-ID: Date: Wed, 12 Oct 2016 12:53:32 +0200 MIME-Version: 1.0 In-Reply-To: <1476267508-19499-1-git-send-email-xiecl.fnst@cn.fujitsu.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] nbd: Use CoQueue for free_sema instead of CoMutex List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Changlong Xie , qemu devel , qemu block , Stefan Hajnoczi , Fam Zheng , Max Reitz , Kevin Wolf , Eric Blake Cc: zhanghailiang , Wen Congyang On 12/10/2016 12:18, Changlong Xie wrote: > + if (s->in_flight == MAX_NBD_REQUESTS) { > + qemu_co_queue_wait(&s->free_sema); > assert(s->in_flight < MAX_NBD_REQUESTS); > } I was wondering if this should be a while loop instead, but the assertion protects against that. So: Reviewed-by: Paolo Bonzini