All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: NFS TCP race condition with SOCK_ASYNC_NOSPACE
Date: Tue, 22 Nov 2011 12:02:15 +0000	[thread overview]
Message-ID: <4ECB8F47.105@citrix.com> (raw)
In-Reply-To: <1321961913.3323.67.camel@lade.trondhjem.org>

On 22/11/11 11:38, Trond Myklebust wrote:
> On Mon, 2011-11-21 at 18:14 +0000, Andrew Cooper wrote: 
>> Following some debugging, I believe that the attached patch fixes the
>> problem.
>>
>> Simply returning EAGAIN is not sufficient, as the task does not get
>> requeued, and times out 13 seconds later (as per our mount options). 
>> Setting the SOCK_ASYNC_NOSPACE bit causes the requeue to happen.
>>
>> I realize that this is a gross hack and I should probably not be using
>> SOCK_ASYNC_NOSPACE in that way.  Is there a better way to achieve the
>> same solution?
>>
> What you are doing will cause the request to be put to sleep with no
> guarantee that it will ever be woken up. Why would we want to do that if
> there is no report of a tcp window/buffer space congestion?

But the reason we get to this code is because there was a report of
space collision.  What would you suggest instead?  Changing
xs_{tcp,udp}_send_request() to retry in this case would defeat the point
of having xs_nospace().

What should happen is the request getting re-queued to run at the next
available opportunity, rather than perhaps sleeping for a certain length
of time.  At the moment, leaving SOCK_ASYNC_NOSPACE unset causes the
request to never be woken, whereas setting that bit seems to always be
re-queued at some near point in the future.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


  reply	other threads:[~2011-11-22 12:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 18:40 NFS TCP race condition with SOCK_ASYNC_NOSPACE Andrew Cooper
2011-11-18 18:40 ` Andrew Cooper
2011-11-18 18:52 ` Trond Myklebust
2011-11-18 18:52   ` Trond Myklebust
2011-11-18 19:04   ` Andrew Cooper
2011-11-18 19:04     ` Andrew Cooper
2011-11-18 19:14     ` Trond Myklebust
2011-11-18 19:14       ` Trond Myklebust
2011-11-18 19:55       ` Andrew Cooper
2011-11-18 19:55         ` Andrew Cooper
2011-11-21 18:14         ` Andrew Cooper
2011-11-21 18:14           ` Andrew Cooper
2011-11-22 11:38           ` Trond Myklebust
2011-11-22 11:38             ` Trond Myklebust
2011-11-22 12:02             ` Andrew Cooper [this message]
2011-11-22 12:10               ` Trond Myklebust
2011-11-22 12:16                 ` Andrew Cooper
2011-11-22 12:22                   ` Trond Myklebust
2011-11-22 12:34                     ` Andrew Cooper
2011-11-22 12:34                       ` Andrew Cooper
2011-11-22 12:45                       ` Trond Myklebust
2011-11-22 12:45                         ` Trond Myklebust
2011-11-22 13:23                         ` Andrew Cooper
2011-11-22 13:23                           ` Andrew Cooper

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=4ECB8F47.105@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.