Linux NFS development
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: open list <linux-kernel@vger.kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: contention on pwq->pool->lock under heavy NFS workload
Date: Wed, 21 Jun 2023 11:28:38 -1000	[thread overview]
Message-ID: <ZJNrht3NlLyPn2A0@slm.duckdns.org> (raw)
In-Reply-To: <38FA0353-5303-4A3D-86A5-EF1E989CD497@oracle.com>

Hello,

On Wed, Jun 21, 2023 at 03:26:22PM +0000, Chuck Lever III wrote:
> lock_stat reports that the pool->lock kernel/workqueue.c:1483 is the highest
> contended lock on my test NFS client. The issue appears to be that the three
> NFS-related workqueues, rpciod_workqueue, xprtiod_workqueue, and nfsiod all
> get placed in the same worker_pool, so they have to fight over one pool lock.
> 
> I notice that ib_comp_wq is allocated with the same flags, but I don't see
> significant contention there, and a trace_printk in __queue_work shows that
> work items queued on that WQ seem to alternate between at least two different
> worker_pools.
> 
> Is there a preferred way to ensure the NFS WQs get spread a little more fairly
> amongst the worker_pools?

Can you share the output of lstopo on the test machine?

The following branch has pending workqueue changes which makes unbound
workqueues finer grained by default and a lot more flexible in how they're
segmented.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git affinity-scopes-v2

Can you please test with the brnach? If the default doesn't improve the
situation, you can set WQ_SYSFS on the affected workqueues and change their
scoping by writing to /sys/devices/virtual/WQ_NAME/affinity_scope. Please
take a look at

 https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git/tree/Documentation/core-api/workqueue.rst?h=affinity-scopes-v2#n350

for more details.

Thanks.

-- 
tejun

  reply	other threads:[~2023-06-21 21:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 15:26 contention on pwq->pool->lock under heavy NFS workload Chuck Lever III
2023-06-21 21:28 ` Tejun Heo [this message]
2023-06-22 14:38   ` Chuck Lever III
2023-06-22 15:45   ` Chuck Lever III
2023-06-22 19:23     ` Tejun Heo
2023-06-22 19:39       ` Chuck Lever III
2023-06-23 14:37         ` Chuck Lever III
2023-06-24  1:44           ` Tejun Heo
2023-06-25 16:01             ` Chuck Lever III
2023-06-26 20:21               ` Tejun Heo

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=ZJNrht3NlLyPn2A0@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=chuck.lever@oracle.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