xfs
[Top] [All Lists]

Re: sleeps and waits during io_submit

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: sleeps and waits during io_submit
From: Avi Kivity <avi@xxxxxxxxxxxx>
Date: Tue, 1 Dec 2015 21:50:38 +0200
Cc: Brian Foster <bfoster@xxxxxxxxxx>, Glauber Costa <glauber@xxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scylladb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=GiD9O6Gj0/iDLO8qLVK/O/k5DtJNjU2pHkAZvTucgvg=; b=bkCVMr12wyDWSnc9vOnFg4OEYB81+cDyhrAD+ntow82zOe2jikyrRn/LAAvsOh7MdM +ZptoLbwevERkueSiuOkwbO87b0F9bNCFRK6YX9PEIzkIJWH229ExWwToXacgX064LaV ur1GQs7odp0JNPvFGNdf8KZAN/SSz1R7uw8Mqonk/Yo2RDcA1EporeMrT+rsivktZwDV hW9BA00UQVMNv0ouTlWS8Wrl2Xhq1inGTSza6FElBH4PlRLMRXuHU7h0KMx4RGB//Iez Vtdwnq2GPwqRjj9jjOmUi7lj0TZF+1CD0mCPlm/BYXTkqcnJoRfRSDjuyLgLjx7pcHia 4TJQ==
In-reply-to: <20151201194139.GA19035@xxxxxxxxxxxxx>
References: <20151201131114.GA26129@xxxxxxxxxxxxxxx> <565DA784.5080003@xxxxxxxxxxxx> <20151201145631.GD26129@xxxxxxxxxxxxxxx> <565DBB3E.2010308@xxxxxxxxxxxx> <20151201160133.GE26129@xxxxxxxxxxxxxxx> <565DC613.4090608@xxxxxxxxxxxx> <20151201162958.GF26129@xxxxxxxxxxxxxxx> <565DD449.5090101@xxxxxxxxxxxx> <20151201185113.GG26129@xxxxxxxxxxxxxxx> <565DF472.8080101@xxxxxxxxxxxx> <20151201194139.GA19035@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
On 12/01/2015 09:41 PM, Christoph Hellwig wrote:
On Tue, Dec 01, 2015 at 09:26:42PM +0200, Avi Kivity wrote:
It's basically the same thing.  To to this, we'd have get_block either
return the block's address (if it was in some metadata cache), or, if it was
not, issue an I/O that fills (part of) that cache, and as its completion
function, a continuation that reruns __blockdev_direct_IO from the point it
was stopped so it can submit the data I/O (if the metadata cache was
completely updated) or issue the next I/O aiming to fill that metadata
cache, if it was not.
We did something this for blocking reads with great results, and it could be
done similarly for direct I/O I think:

        https://lwn.net/Articles/612483/

Unfortunately Andrew shut it down for odd reasons so it didn't get in.

How would this work? io_submit() returns -ENOTALLMETADATAISINCACHE, user calls io_submit() again from a worker thread, where he doesn't mind blocking?

In fact sys_io_submit() could catch this error and resubmit the I/O on its own using a work item, and io_submit() would become non-blocking, at least on I/O (lock contention may still be a problem, but a smaller one).

<Prev in Thread] Current Thread [Next in Thread>