mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"Adamson, Dros" <Weston.Adamson@netapp.com>
Subject: Re: nfsd oops on Linus' current tree.
Date: Fri, 21 Dec 2012 18:08:49 -0500	[thread overview]
Message-ID: <20121221230849.GB29739@fieldses.org> (raw)
In-Reply-To: <4FA345DA4F4AE44899BD2B03EEEC2FA91197273D@SACEXCMBX04-PRD.hq.netapp.com>

On Fri, Dec 21, 2012 at 06:40:54PM +0000, Myklebust, Trond wrote:
> On Fri, 2012-12-21 at 13:08 -0500, J. Bruce Fields wrote:
> > On Fri, Dec 21, 2012 at 10:33:48AM -0500, Dave Jones wrote:
> > > Did a mount from a client (also running Linus current), and the
> > > server spat this out..
> > > 
> > > [ 6936.306135] ------------[ cut here ]------------
> > > [ 6936.306154] WARNING: at net/sunrpc/clnt.c:617 rpc_shutdown_client+0x12a/0x1b0 [sunrpc]()
> > 
> > This is a warning added by 168e4b39d1afb79a7e3ea6c3bb246b4c82c6bdb9
> > "SUNRPC: add WARN_ON_ONCE for potential deadlock", pointing out that
> > nfsd is calling shutdown_client from a workqueue, which is a problem
> > because shutdown_client has to wait on rpc tasks that run on a
> > workqueue.
> > 
> > I don't believe there's any circular dependency among the workqueues
> > (we're calling shutdown_client from callback_wq, not rpciod_workqueue),
> 
> We were getting deadlocks with rpciod when calling rpc_shutdown_client
> from the nfsiod workqueue.
> 
> The problem here is that the workqueues all run using the same pool of
> threads, and so you can get "interesting" deadlocks when one of these
> threads has to wait for another one.

OK, coming back after reviewing Documentation/workqueue.txt: the
workqueues potentially involved here are rpciod and the server's
laundromat and callback workqueues.

The former is created with

	alloc_workqueue("rpciod", WQ_MEM_RECLAIM, 1);

and the latter two are both created with
create_singlethread_workqueue(), which also sets WQ_MEM_RECLAIM.

As I understand it, that ensures that each of the three has at least one
"rescuer" thread dedicated to it--so there shouldn't be any deadlock as
long as there's no circular dependency among the three.

So think this is a false positive--am I missing something?

> > but 168e4b39d1afb.. says that we could get a deadlock if both are
> > running on the same kworker thread.
> > 
> > I'm not sure what to do about that.
> > 
> 
> The question is if you really do need the call to rpc_killall_tasks and
> the synchronous wait for completion of old tasks? If you don't care,
> then we could just have you call rpc_release_client() in order to
> release your reference on the rpc_client.

No, the waiting's intentional: for example, the laundromat wq is what's
responsible for reaping expired clients, and it wants to wait for
callback rpc's to exit.  (If I remember right they may reference data
structures we're about to clean up).

--b.

  reply	other threads:[~2012-12-21 23:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21 15:33 Dave Jones
2012-12-21 18:08 ` J. Bruce Fields
2012-12-21 18:40   ` Myklebust, Trond
2012-12-21 23:08     ` J. Bruce Fields [this message]
2012-12-21 23:15       ` Myklebust, Trond
2012-12-21 23:26         ` J. Bruce Fields
2012-12-21 23:36           ` Myklebust, Trond
2012-12-21 23:45             ` J. Bruce Fields
2013-01-03 16:28               ` Adamson, Dros
2013-01-03 20:11                 ` J. Bruce Fields
2013-01-03 20:27                   ` Adamson, Dros
2013-01-03 20:52                     ` J. Bruce Fields
2013-01-03 22:15                       ` Tejun Heo
2013-01-03 22:08                   ` Tejun Heo
2013-01-03 22:12                     ` Myklebust, Trond
2013-01-03 22:26                       ` Tejun Heo
2013-01-03 22:34                         ` Tejun Heo
2013-01-03 23:11                         ` Myklebust, Trond
     [not found]                         ` <1357254692.55285.33.camel@lade.trondhjem.org>
2013-01-03 23:26                           ` Myklebust, Trond
2013-01-04 17:11                             ` Adamson, Dros
2013-01-03 22:03                 ` Tejun Heo
2013-01-03 23:08                   ` J. Bruce Fields
2012-12-22  0:48   ` [PATCH] Revert "nfsd: warn on odd reply state in nfsd_vfs_read" J. Bruce Fields

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=20121221230849.GB29739@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=Weston.Adamson@netapp.com \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®