public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Avi Kivity <avi@scylladb.com>
Cc: linux-xfs@vger.kernel.org, Glauber Costa <glauber@scylladb.com>,
	Raphael Carvalho <raphaelsc@scylladb.com>
Subject: Re: Intermittent zeroed pages with AIO+DIO+XFS
Date: Fri, 4 Aug 2017 08:09:22 +1000	[thread overview]
Message-ID: <20170803220922.GA21024@dastard> (raw)
In-Reply-To: <dac170a5-d11f-c8ce-3890-8b5629364c18@scylladb.com>

On Thu, Aug 03, 2017 at 05:52:45PM +0300, Avi Kivity wrote:
> Hello,
> 

Hi Avi,

> I have an application that uses AIO+DIO to write data to a file on
> XFS. The writes use 128k buffers. Very rarely, I see aligned 4k
> blocks within the file that are zeroed. The blocks are not aligned
> to 128k boundary, just 4k. The buffers are allocated in anonymous
> memory, which is usually using transparent hugepages.  The files are
> fully allocated, not sparse (checked post-mortem).

Did you check that the extents are written? i.e. there aren't
sporadic 4k unwritten extents in the file? (xfs_bmap -vvp output)

If you turn off transparent huge pages, does the problem go
away?

What kernel version is this seen on? We've changed the XFS DIO
IO path implementation substantially in recent times....

> The writes are concurrent and adjacent. To avoid serialization, we
> ftruncate() the file to a larger size, then ftruncate() it back when
> we know its final size.

So it's not extending the file on the writes, so it shouldn't be
triggering EOF block zeroing. The only thing I can think of is
either the data contains zeros or there's an occasional unwritten
extent in the file.

> Does this trigger anything in anyone's mind?

Nope - do you have a reproducer you can share?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2017-08-03 22:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 14:52 Intermittent zeroed pages with AIO+DIO+XFS Avi Kivity
2017-08-03 22:09 ` Dave Chinner [this message]
2017-08-04  2:40   ` Avi Kivity
2017-08-04  2:50     ` Glauber Costa
2017-08-04  3:14     ` Dave Chinner
2017-08-04  3:36       ` Avi Kivity
2017-08-04  4:04         ` Raphael S. Carvalho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170803220922.GA21024@dastard \
    --to=david@fromorbit.com \
    --cc=avi@scylladb.com \
    --cc=glauber@scylladb.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=raphaelsc@scylladb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox