xfs
[Top] [All Lists]

Re: sleeps and waits during io_submit

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: sleeps and waits during io_submit
From: Avi Kivity <avi@xxxxxxxxxxxx>
Date: Tue, 8 Dec 2015 15:56:52 +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=rJVpRSLpZJhJ0m6j1Rg1fTc3nWOlTOOYLwYdLQN+A3w=; b=1E1Mo6lAY6VUlWVkpoVDEaqFvwcwQ3wZWRMjZNh/2TthdKoUnRfy5tsZPwr9Kfx6Cp JIXDo7W5JFr0EXd1jBKiz24x/f2nq757NwAkwbPpiy5etDNgCetvLO6qhJiLu6MHW4tx B9jZ/BEfzynNI8d6UOZGRA54B1V+k+dZGXe3YTfqPziffGmpmaziIvgPv9XS4aE0bUB1 AGnAxeYJOUrr0SGxBGOeBbGyGp0YrJfwzBsQr+10Nbt4Y95x4I870lKMeaKXyneI21+Z shwa+LGW+edbxsKtoJYAn/GIhDKRnj4a4yZya73cUGz7qFEexeURcn+5EcmxE1GQ9PgY GxYw==
In-reply-to: <20151208060343.GC19802@dastard>
References: <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> <565EAD06.5060403@xxxxxxxxxxxx> <20151208060343.GC19802@dastard>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0


On 12/08/2015 08:03 AM, Dave Chinner wrote:
On Wed, Dec 02, 2015 at 10:34:14AM +0200, Avi Kivity wrote:
On 12/02/2015 02:13 AM, Brian Foster wrote:
Metadata is modified in-core and handed off to the logging
infrastructure via a transaction. The log is flushed to disk some time
later and metadata writeback occurs asynchronously via the xfsaild
thread.
Unless, I expect, if the log is full.  Since we're hammering on the
disk quite heavily, the log would be fighting with user I/O and
possibly losing.

Does XFS throttle user I/O in order to get the log buffers recycled faster?
No. XFS tags the metadata IO with REQ_META that the IO schedulers
can tell the difference between metadata and data IO, and schedule
them appropriately. Further. log buffers are also tagged with
REQ_SYNC to indicate they are latency sensitive IOs, whcih the IO
schedulers again treat differently to minimise latency in the face
of bulk async IO which is not latency sensitive.

IOWs, IO prioritisation and dispatch scheduling is the job of the IO
scheduler, not the filesystem. The filesystem just tells the
scheduler how to treat the different types of IO...

Is there any way for us to keep track of it, and reduce disk
pressure when it gets full?
Only if you want to make more problems for yourself - second
guessing what the filesystem is going to do will only lead you to
dancing the Charlie Foxtrot on a regular basis. :/

So far the best approach I found that doesn't conflict with this is to limit io_submit iodepth to the natural disk iodepth (or a small multiple thereof). This seems to keep XFS in its comfort zone, and is good for latency anyway.

The only issue is that the only way to obtain this parameter is to measure it.

I wrote a small tool to do this [1], but it's a hassle for users.

[1] https://github.com/avikivity/diskplorer

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