linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <trondmy@hammerspace.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] SUNRPC: Use poll() to fix up the socket requeue races
Date: Tue, 19 Feb 2019 10:20:41 -0500	[thread overview]
Message-ID: <255A7507-061E-41C3-84A4-211DFFB702ED@oracle.com> (raw)
In-Reply-To: <e0a1f082b017aadb98dec3f8df6de7a49c078fac.camel@hammerspace.com>



> On Feb 19, 2019, at 10:13 AM, Trond Myklebust <trondmy@hammerspace.com> wrote:
> 
> On Tue, 2019-02-19 at 09:54 -0500, Chuck Lever wrote:
>> Hi Trond-
>> 
>>> On Feb 19, 2019, at 9:06 AM, Trond Myklebust <trondmy@gmail.com>
>>> wrote:
>>> 
>>> Because we clear XPRT_SOCK_DATA_READY before reading, we can end up
>>> with a situation where new data arrives, causing xs_data_ready() to
>>> queue up a second receive worker job for the same socket, which
>>> then
>>> immediately gets stuck waiting on the transport receive mutex.
>>> The fix is to only clear XPRT_SOCK_DATA_READY once we're done
>>> reading,
>>> and then to use poll() to check if we might need to queue up a new
>>> job in order to deal with any new data.
>> 
>> Does this fix an application-visible hang, or is it merely a
>> performance
>> optimization?
> 
> I'm not aware of any hang associated with this behaviour. The patch is
> rather intended as an optimisation to avoid having these threads block
> uselessly on a mutex.

That was my guess, thanks, just wanted to make certain.

--
Chuck Lever




      reply	other threads:[~2019-02-19 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19 14:06 [PATCH] SUNRPC: Use poll() to fix up the socket requeue races Trond Myklebust
2019-02-19 14:54 ` Chuck Lever
2019-02-19 15:13   ` Trond Myklebust
2019-02-19 15:20     ` Chuck Lever [this message]

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=255A7507-061E-41C3-84A4-211DFFB702ED@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@hammerspace.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;
as well as URLs for NNTP newsgroup(s).