Linux NFS development
 help / color / mirror / Atom feed
From: Alex Bligh <alex@alex.org.uk>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org, ian.campbell@citrix.com,
	Alex Bligh <alex@alex.org.uk>
Subject: Re: Fatal crash with NFS, AIO & tcp retransmit
Date: Wed, 23 Jan 2013 15:22:46 +0000	[thread overview]
Message-ID: <DABFD69DFA23FF330123B298@nimrod.local> (raw)
In-Reply-To: <4FA345DA4F4AE44899BD2B03EEEC2FA915C1781E@SACEXCMBX04-PRD.hq.netapp.com>

Trond,

--On 21 January 2013 17:20:36 +0000 "Myklebust, Trond" 
<Trond.Myklebust@netapp.com> wrote:

>> So, just to be clear, if a process is using NFS and AIO with O_DSYNC
>> (but not O_DIRECT) - which is I think what QEMU is meant to be doing -
>> then it should *never* be zero copy (even if writes happen to be
>> appropriately aligned). Is that correct? If so, I can strace the
>> process and see exactly what flags it is using.
>>
>
> That is correct. If you want zero-copy, then O_DIRECT is your thing
> (with or without aio). Otherwise, the kernel will always write to disk
> by copying through the page cache.

Just to follow up on this, QEMU (specifically hw/xen_disk.c) was using
O_DIRECT. If O_DIRECT is turned off, we get an additional page copy
but the bug does not appear.

It thus appears that the root of the problem is that if an AIO NFS
request is made with O_DIRECT, AIO can report the request is completed
even when the segment may need to be retransmitted, and whilst the
TCP stack correctly holds a reference to the page concerned, this
is not currently preventing Xen unmapping it as Xen thinks the IO
has completed.

I believe this problem may apply to iSCSI and for that matter (e.g.)
DRDB too.

-- 
Alex Bligh

  parent reply	other threads:[~2013-01-23 15:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 13:06 Fatal crash with NFS, AIO & tcp retransmit Alex Bligh
2013-01-21 14:38 ` Myklebust, Trond
2013-01-21 15:01   ` Alex Bligh
2013-01-21 15:10     ` Alex Bligh
2013-01-21 15:21       ` Ian Campbell
2013-01-25 13:45         ` Alex Bligh
2013-01-21 15:50     ` Myklebust, Trond
2013-01-21 15:54       ` Ian Campbell
2013-01-21 17:12       ` Alex Bligh
2013-01-21 17:20         ` Myklebust, Trond
2013-01-21 17:29           ` Alex Bligh
2013-01-23 15:22           ` Alex Bligh [this message]
2013-01-23 15:34             ` Myklebust, Trond
2013-01-23 17:33               ` Alex Bligh
2013-01-23 17:37                 ` Myklebust, Trond
2013-01-23 17:42                   ` Alex Bligh
2013-01-23 17:48                     ` Peter Staubach
2013-01-23 18:13                       ` Myklebust, Trond
2013-01-23 19:37                         ` Alex Bligh
2013-01-24 10:42                           ` Ian Campbell
2013-01-24 12:00                             ` Alex Bligh

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=DABFD69DFA23FF330123B298@nimrod.local \
    --to=alex@alex.org.uk \
    --cc=Trond.Myklebust@netapp.com \
    --cc=ian.campbell@citrix.com \
    --cc=linux-nfs@vger.kernel.org \
    /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