xfs
[Top] [All Lists]

Re: sleeps and waits during io_submit

To: Dave Chinner <david@xxxxxxxxxxxxx>, Brian Foster <bfoster@xxxxxxxxxx>
Subject: Re: sleeps and waits during io_submit
From: Avi Kivity <avi@xxxxxxxxxxxx>
Date: Wed, 2 Dec 2015 10:38:16 +0200
Cc: 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=A2yzCtMf8KxGBf9WGYGp/6YVRpgXtIOnXB1xO3wplLg=; b=RseoY5/yuoCxjvcEOOSd9/NmU5hXeLmi/SswQaQiFo2oRkHfnNfsqYs/EZnuDEY61Z FcXqzwBsiUOBgHlnYtlX6EiGe/IM2nu+8lSYKJCiTmU5p7aAhtVOMde4Xqp/cusj+OCF Q+sIoW3AkCrNixX++t7jWGlDJ6tIaPIA0yoOnUQbwaVQ8dJ2ICffhUhubeREMvaC6f7i ZXnvcIu9I8Ev3ZBYsvgpDvXwFe9k0vWhfVBUPapBox8xQPmLIqg8q1dz1vZwOACquBx8 fZwfKpqH38tPVm+sxyYeucMO98Ig9msszDW/JixdmdqqTC6mOXkH8TjUl8hYC2N3brk7 YuoQ==
In-reply-to: <20151202005728.GG19199@dastard>
References: <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> <20151202001329.GA9633@xxxxxxxxxxxxxxx> <20151202005728.GG19199@dastard>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 12/02/2015 02:57 AM, Dave Chinner wrote:
On Tue, Dec 01, 2015 at 07:13:29PM -0500, Brian Foster wrote:
On Tue, Dec 01, 2015 at 09:26:42PM +0200, Avi Kivity wrote:
On 12/01/2015 08:51 PM, Brian Foster wrote:
On Tue, Dec 01, 2015 at 07:09:29PM +0200, Avi Kivity wrote:
Nope, it's synchronous from a code perspective. The
xfs_bmapi_read()->xfs_iread_extents() path could have to read in the
inode bmap metadata if it hasn't been done already. Note that this
should only happen once as everything is stored in-core, so in most
cases this is skipped. It's also possible extents are read in via some
other path/operation on the inode before an async I/O happens to be
submitted (e.g., see some of the other xfs_bmapi_read() callers).
Is there (could we add) some ioctl to prime this cache?  We could call it
from a worker thread where we don't mind blocking during open.

I suppose that's possible, or the worker thread could perform some
existing operation known to prime the cache. I don't think it's worth
getting into without a concrete example, however.
You mean like EXT4_IOC_PRECACHE_EXTENTS?

You know, that ioctl that the ext4 googlers needed to add because
they already had AIO applications that depend on it and they hadn't
realised that the could do exactly the same thing with a FIEMAP
call? i.e. this call to count the number of extents in the file:

        struct fiemap fm = {
                .offset = 0,
                .length = FIEMAP_MAX_OFFSET,
        };

        res = ioctl(fd, FS_IOC_FIEMAP, &fm);

will cause XFS to read in the extent map and cache it.


Cool, it even appears to be callable with CAP_WHATEVER. So we would use this to prime the metadata caches before startup, if they turn out to be a problem in practice.

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