linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bfields@fieldses.org (J. Bruce Fields)
To: Chris Takemura <ctakemura@google.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: nfsd threads hanging in nfsd4_cstate_assign_replay?
Date: Fri, 8 Jun 2018 12:16:05 -0400	[thread overview]
Message-ID: <20180608161605.GB12719@fieldses.org> (raw)
In-Reply-To: <CAJf8aWTT-UMvTm6uKumm9kVBF+7mcfzoL51GM8kJJ=3TgY_HBg@mail.gmail.com>

On Mon, Jun 04, 2018 at 01:22:05PM -0700, Chris Takemura wrote:
> Hi linux-nfs,
> 
> I've got an NFS server that's behaving a little oddly -- it loses
> threads to disk sleep at the rate of about 1 every 5 minutes.  Threads
> stuck in this state all have the same stack:
> 
> [<ffffffffc069e4ce>] nfsd4_cstate_assign_replay.part.78+0x1e/0x30 [nfsd]
> [<ffffffffc06a4ecc>] nfs4_preprocess_seqid_op+0xfc/0x190 [nfsd]
> [<ffffffffc06a5bb6>] nfsd4_close+0x66/0x2c0 [nfsd]
> [<ffffffffc06934fe>] nfsd4_proc_compound+0x3be/0x720 [nfsd]
> [<ffffffffc067fec6>] nfsd_dispatch+0xd6/0x270 [nfsd]
> [<ffffffffc04eef16>] svc_process_common+0x456/0x730 [sunrpc]
> [<ffffffffc04ef2f5>] svc_process+0x105/0x1c0 [sunrpc]
> [<ffffffffc067f8f0>] nfsd+0xf0/0x160 [nfsd]
> [<ffffffffb109f158>] kthread+0xd8/0xf0
> [<ffffffffb181b6f5>] ret_from_fork+0x55/0x80
> [<ffffffffffffffff>] 0xffffffffffffffff

Looks like they're trying to so->so_replay.rp_mutex but are getting
stuck on it indefinitely.

That mutex is supposed to be released by nfsd4_cstate_clear_replay().

So it's a matter of tracing through the callers to figure out if there's
a codepath where one's called but not the other.

There's no way out of the main op-processing loop in
nfsd4_proc_compound() without calling nfsd4_cstate_clear_replay() at the
end.

I don't see it immediately.  Most likely might be
nfsd4_cstate_assign_replay getting called twice somehow.  We could
stick a WARN_ON_ONCE(cstate->replay_ownere) at the start of that
function.

Might also be interesting to know whether the problem's still
reproduceable on a more recent kernel.

--b.

> 
> This is on ubuntu, with kernel version 4.4.0-119-generic
> #143~14.04.1-Ubuntu.  As you can tell from the backtrace, it's serving
> NFS4.
> 
> I've been increasing the thread count to compensate for the hung
> threads -- note that the total number of threads doesn't affect the
> rate of hangs, which is stubbornly constant.
> 
> Do you have any idea what could be causing this, and how I can stop
> it, preferably without interrupting service?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2018-06-08 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 20:22 nfsd threads hanging in nfsd4_cstate_assign_replay? Chris Takemura
2018-06-08 16:16 ` J. Bruce Fields [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=20180608161605.GB12719@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=ctakemura@google.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;
as well as URLs for NNTP newsgroup(s).