linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Tejun Heo <tj@kernel.org>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>,
	NFS <linux-nfs@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] NFS: state manager thread must stay running.
Date: Mon, 18 Aug 2014 07:14:57 +1000	[thread overview]
Message-ID: <20140818071457.4b345727@notabene.brown> (raw)
In-Reply-To: <20140817131156.GB7679@mtj.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

On Sun, 17 Aug 2014 09:11:56 -0400 Tejun Heo <tj@kernel.org> wrote:

> Hello, Neil.
> 
> On Wed, Aug 13, 2014 at 02:08:31PM +1000, NeilBrown wrote:
> > There are two interesting requirements for the manager thread:
> > 1/ It must allow SIGKILL, which can abort NFS transactions to
> >    a dead server.
> > 2/ It may continue running after the filesystem is unmounted,
> >    until the server recovers or the thread is SIGKILLed
> 
> Out of curiosity, why is SIGKILL handling necessary at all?  Can't nfs
> just keep the manager running while any mount is active?

It does.  The manage will even continue after there are no mounts active if
it is blocked on a non-responding server.

If there is an outstanding RPC request to a non-responsive server
then the only way to abort that request is to send SIGKILL to the thread
which is waiting for the request.
So if we want things to clean up properly on shutdown it seems best for a
sigkill to be able to abort that thread.

It is quite likely that a deep re-write of various details could simplify
this.   There seems little point in the manager continuing after the lease
timeout has expired for example.  So there could be better ways to clean up.
However I think we probably do want the state manager to continue trying at
least until the lease time expires, so we cannot clean up the thread at
unmount time - it needs to persist at least a little while.

It is also possible that I'm missing some important details.  I really just
wanted to avoid the possible memory deadlock without breaking anything that
I didn't completely understand..  The proposed patch is the best I could do.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2014-08-17 21:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13  4:08 [PATCH] NFS: state manager thread must stay running NeilBrown
2014-08-17 13:11 ` Tejun Heo
2014-08-17 21:14   ` NeilBrown [this message]
2014-08-18 14:29     ` Tejun Heo
2014-09-17  1:43 ` Trond Myklebust
2014-09-17  3:05   ` NeilBrown

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=20140818071457.4b345727@notabene.brown \
    --to=neilb@suse.de \
    --cc=hch@infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=trond.myklebust@primarydata.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).