All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@poochiereds.net>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd: use a multithreaded workqueue for nfsd4_callbacks
Date: Mon, 12 Oct 2015 16:14:21 -0400	[thread overview]
Message-ID: <20151012161421.1468a79b@synchrony.poochiereds.net> (raw)
In-Reply-To: <20151012181117.GF28755@fieldses.org>

On Mon, 12 Oct 2015 14:11:17 -0400
"J. Bruce Fields" <bfields@fieldses.org> wrote:

> On Fri, Oct 09, 2015 at 05:39:23PM -0400, Jeff Layton wrote:
> > On Fri, 9 Oct 2015 17:24:59 -0400
> > "J. Bruce Fields" <bfields@fieldses.org> wrote:
> > 
> > > On Sat, Oct 03, 2015 at 08:38:02AM -0400, Jeff Layton wrote:
> > > > I don't see any need to order callbacks with respect to one another.
> > > 
> > > I thought the code in nfsd4_process_cb_update really depended on this.
> > > The locking it has is against nfsd threads, it probably assumes it's
> > > only run from a cb thread and that it's the only one running at a time.
> > > 
> > > But I haven't reviewed it lately.
> > > 
> > > --b.
> > > 
> > 
> > Yikes -- ok. That's not at all obvious. That should prob be documented
> > if so.
> 
> Yes, my bad.
> 
> > Yeah, ok...I guess you could end up with multiple threads racing to
> > tear down the cb_client and xprt and create a new one, and it looks
> > like the cl_cb_client and cl_cred pointers could get clobbered by new
> > ones in that case.
> > 
> > Shouldn't be too hard to fix protecting those pointers with the
> > cl_lock. That said, I prob won't be able to spend time on it right now.
> > You can go ahead and drop that patch and I'll resend if/when I get
> > around to fixing that.
> 
> What's the problem that this fixes exactly?
> 

Unnecessary serialization of callbacks?

Not that that's necessarily a problem, but with the newer workqueue
implementation there is more overhead in running a single threaded
workqueue since it implies a rescuer thread and has to do extra work
to ensure that the jobs are run in sequential order.

If that serialization is not actually needed, then it's better to move
it to a multithreaded workqueue.

-- 
Jeff Layton <jlayton@poochiereds.net>

  reply	other threads:[~2015-10-12 20:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03 12:38 [PATCH] nfsd: use a multithreaded workqueue for nfsd4_callbacks Jeff Layton
2015-10-09 21:24 ` J. Bruce Fields
2015-10-09 21:39   ` Jeff Layton
2015-10-12 18:11     ` J. Bruce Fields
2015-10-12 20:14       ` Jeff Layton [this message]
2015-10-12 20:20         ` J. Bruce Fields
2015-10-12 21:02           ` Jeff Layton
2015-10-12 21:07             ` 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=20151012161421.1468a79b@synchrony.poochiereds.net \
    --to=jlayton@poochiereds.net \
    --cc=bfields@fieldses.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 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.