From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xss9Z-0005cb-1G for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xss9R-0002lk-HB for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:50:00 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:52270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xss9R-0002lZ-BQ for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:49:53 -0500 Received: from mail-oi0-f54.google.com ([209.85.218.54]) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1Xss9Q-0007sf-Lb for qemu-devel@nongnu.org; Mon, 24 Nov 2014 11:49:52 +0000 Received: by mail-oi0-f54.google.com with SMTP id u20so6377758oif.41 for ; Mon, 24 Nov 2014 03:49:51 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <547318D0.9090400@redhat.com> References: <1416828693-30767-1-git-send-email-ming.lei@canonical.com> <1416828693-30767-3-git-send-email-ming.lei@canonical.com> <547318D0.9090400@redhat.com> Date: Mon, 24 Nov 2014 19:49:51 +0800 Message-ID: From: Ming Lei Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 2/3] linux-aio: handling -EAGAIN for !s->io_q.plugged case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , qemu-devel , Stefan Hajnoczi On Mon, Nov 24, 2014 at 7:38 PM, Paolo Bonzini wrote: > > > On 24/11/2014 12:31, Ming Lei wrote: >> + /* don't submit until next completion for -EAGAIN of non plug case */ >> + if (unlikely(!s->io_q.plugged)) { >> + return 0; >> + } >> + >> /* submit immediately if queue depth is above 2/3 */ >> if (idx > s->io_q.size * 2 / 3) { >> return ioq_submit(s); > } > > return 0; > > so I fail to see why my proposal: > > > /* This is reached in two cases: queue not plugged but io_submit > * returned -EAGAIN, or queue plugged. In the latter case, start > * submitting some I/O if the queue is getting too full. In the > * former case, instead, wait until an I/O operation is completed. > */ > if (likely(idx <= s->io_q.size * 2 / 3) || unlikely(!s->io_q.plugged) { > return 0; > } > > return ioq_submit(s); > > was wrong. Can you explain? I didn't say your proposal is wrong, and this patch is correct too without fat comment. The difference is only that this patch returns immediately in case of !s->io_q.plugged after putting the req into io queue. Thanks,