From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzxSv-00049r-Ux for qemu-devel@nongnu.org; Tue, 11 Nov 2008 12:55:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzxSu-00049F-NK for qemu-devel@nongnu.org; Tue, 11 Nov 2008 12:55:49 -0500 Received: from [199.232.76.173] (port=43300 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzxSu-00048z-8Q for qemu-devel@nongnu.org; Tue, 11 Nov 2008 12:55:48 -0500 Received: from qw-out-1920.google.com ([74.125.92.146]:62069) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzxSt-00029e-QZ for qemu-devel@nongnu.org; Tue, 11 Nov 2008 12:55:48 -0500 Received: by qw-out-1920.google.com with SMTP id 5so4631qwc.4 for ; Tue, 11 Nov 2008 09:55:46 -0800 (PST) Message-ID: <4919C71E.2030509@codemonkey.ws> Date: Tue, 11 Nov 2008 11:55:42 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch] Fix block I/O hang. References: <4919B46C.3040804@redhat.com> <4919B79A.5030402@codemonkey.ws> <4919C550.5020609@redhat.com> In-Reply-To: <4919C550.5020609@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Gerd Hoffmann wrote: > Anthony Liguori wrote: > >> Gerd Hoffmann wrote: >> >>> Hi, >>> >>> $subject says all. >>> >>> please apply, >>> Gerd >>> >> Under what circumstances? posix_aio_read() is only invoked from a >> select callback. This means there should be data available to be read. >> > > Hmm, looked at the loop again a bit closer. > > First, the check for errno == EAGAIN is superfluous when the filehandle > isn't in non-blocking mode. It will not happen. > > Second, the check for errno == EINTR is superfluous too because the loop > will retry the read() syscall anyway for *any* error. > Yes, this all is. I think the intention was to make it non-blocking so that the full queue could be drained to avoid superfluous calls to posix_aio_read() since it handles all outstanding ops at once. However, > Third, when called from a select callback it shouldn't block indeed. It > does though for me now and then when booting xen guests (with a big > stack of xenner patches). Doesn't reproduce reliable though. Sprinkled > in a printk (with rfd being non-blocking) and got a EAGAIN once, so it > got called with rfd not having data. > I think it would be good to root cause this. AFAICT, it shouldn't block. Regards, Anthony Liguori > cheers, > Gerd > > >