Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, NeilBrown <neil@brown.name>
Cc: Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	 Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
		linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sunrpc: hardcode pool_mode to pernode, remove other modes
Date: Fri, 26 Jun 2026 09:40:24 -0400	[thread overview]
Message-ID: <0a54bd086085ce9b19e258353a37ed953a42847b.camel@kernel.org> (raw)
In-Reply-To: <ac1f3b39-1541-4861-a5b1-3babbc9c1cc7@app.fastmail.com>

On Fri, 2026-06-26 at 09:18 -0400, Chuck Lever wrote:
> On Thu, Jun 25, 2026, at 10:14 PM, NeilBrown wrote:
> > Regarding Chucks comments, I think a minimum of one thread per node,
> > rather than a minimum of one thread total, is the sensible approach.
> > Of course if there exist memory-only nodes, they wouldn't need a thread.
> 
> What happens when transport work is scheduled on a memory-only
> pool? Obviously there's no execution engine there, even if we
> do provide one or more threads.
> 

The hitch here is that we have traditionally allowed userland to
dictate how many threads each pool gets. You're allowed to send down an
array like this with (4 pools):

     0 128 0 0

That would give you exactly that layout (128 threads in pool 2 and none
elsewhere). I think we can continue to honor that by saying that if you
set a thread count of 0 in a pool then we should not spawn any threads
there.

Because of this, I favor a belt and bracers approach:

1/ when min-threads is set, assign at least one thread to each node
that has a cpu as a minimum, but only when we are auto-distributing
threads between nodes (the typical case). This allows us to preserve
the wishes of userland when it sends down a more complex pool array. We
should not override the user's wishes in that case.

2/ add in a fallback in the queueing path so that when there are no
threads in a node, we queue it to a populated one. We could even add a
pr_notice_once() that fires in that case to warn that the configuration
is sub-optimal. The cost is an extra check for sp_nrthreads == 0 when
enqueueing, but it should almost always come back false when things are
properly configured.

-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2026-06-26 13:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 15:59 [PATCH v2] sunrpc: hardcode pool_mode to pernode, remove other modes Jeff Layton
2026-06-25 19:32 ` Chuck Lever
2026-06-26  2:14 ` NeilBrown
2026-06-26 13:18   ` Chuck Lever
2026-06-26 13:40     ` Jeff Layton [this message]
2026-06-26 13:53   ` Jeff Layton

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=0a54bd086085ce9b19e258353a37ed953a42847b.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=anna@kernel.org \
    --cc=cel@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=trondmy@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