mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tmenninger@purestorage.com
To: Chuck Lever <cel@kernel.org>
Cc: Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>, Tejun Heo <tj@kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Eric Badger <ebadger@everpuredata.com>,
	Jon Curley <jcurley@everpuredata.com>
Subject: Re: [PATCH RFC 6/8] SUNRPC: Reduce rpciod workqueue contention
Date: Sat, 12 Sep 2026 14:59:26 +0000	[thread overview]
Message-ID: <20260912145926.208269-1-tmenninger@purestorage.com> (raw)
In-Reply-To: <48e8b6c6-dc62-4630-b7c9-19cdcc5cbf11@slotpi15m67>

Sorry for the delay, I've been without internet.

> 1. Check that sheaves are actually on for that cache:
>
>       cat /sys/kernel/slab/nfs_page/sheaf_capacity
>
>    A zero means your kernel predates sheaves or the cache has debug
>    flags, and the contention is the older remote-free slab
>    transition path. That is a different report.

    root@irp309-h02:/sys/kernel/slab/nfs_page# cat sheaf_capacity
    60

> 2. Build with CONFIG_SLUB_STATS=y and sample these before and after
>    a 10-second all-local window:
>
>    ```
>    cd /sys/kernel/slab/nfs_page
>    grep . free_fastpath free_slowpath sheaf_flush barn_put \
>        barn_put_fail barn_get barn_get_fail alloc_slowpath
>    ```
>
>    If barn_put_fail and sheaf_flush track the contention count, the
>    barn limit is the bottleneck. If free_slowpath dominates and the
>    sheaf counters are quiet, the frees are bypassing sheaves
>    entirely and my analysis is wrong.

10-second deltas:

    free_fastpath:    +49,161,373
    free_slowpath:    +70,391,872
    sheaf_flush:       +1,582,440
    barn_put:            +673,877
    barn_put_fail:        +26,374
    barn_get:            +673,860
    barn_get_fail:     +1,199,576
    alloc_slowpath:             0

> 3. Run perf lock contention with -l on the same window so the lock
>    shows up by address, and note whether the callers under
>    list_lock are sheaf_flush_unused / __kmem_cache_free_bulk or
>    direct __slab_free from kmem_cache_free.

    contended       total wait     avg wait      address
    3,346,091       5.05 min       90.48 us      ff1db88b8f578b80

Filtering the perf lock data to that address gives:

    2,845,710   __slab_free+0x126
      318,458   get_partial_node_bulk+0x9c
      181,842   __refill_objects_node+0x4d0
           71   alloc_from_new_slab+0x183
           10   __slab_free+0x126

The next most contended lock had only 23 contentions.

So about 85% of the contention on the dominant lock is coming directly
from __slab_free. I don't see sheaf_flush_unused or
__kmem_cache_free_bulk among the callers. get_partial_node_bulk is
about 9.5% and __refill_objects_node about 5.4%.

That seems to put this much more firmly in the direct
kmem_cache_free -> __slab_free case you mentioned rather than a barn
limit / sheaf flush bottleneck.

> 4. Tell me the I/O pattern: direct reads, I assume, but the I/O
>    size, number of threads, and how they are spread across the two
>    nodes. I would like to attempt to reproduce the
>    alloc-here-free-there imbalance rather than speculate.

Yes, direct reads. The workload is:

    elbencho \
        --iter 1 \
        --threads 160 \
        --files 16 \
        --size 512G \
        --block 1m \
        --dropcache \
        --iodepth 64 \
        --direct \
        --read \
        --lat \
        --latpercent \
        --log 1 \
        <16 files>

I'm not pinning the elbencho threads to CPUs or NUMA nodes. I just waited
for a run where all of the CQs landed on node 0.

  reply	other threads:[~2026-09-12 14:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 18:21 [PATCH RFC 0/8] Reduce lock contention in the NFS client Chuck Lever
2026-08-31 18:21 ` [PATCH RFC 1/8] SUNRPC: Use atomic_t for XID allocation Chuck Lever
2026-08-31 18:21 ` [PATCH RFC 2/8] SUNRPC: Execute initial async RPC states in caller's context Chuck Lever
2026-08-31 18:21 ` [PATCH RFC 3/8] SUNRPC: Split recv_lock out of xprt->queue_lock Chuck Lever
2026-08-31 18:22 ` [PATCH RFC 4/8] Set WQ_SYSFS on key NFS-related workqueues Chuck Lever
2026-08-31 18:22 ` [PATCH RFC 5/8] workqueue: Export the functions needed for WQ attribute modification Chuck Lever
2026-08-31 18:22 ` [PATCH RFC 6/8] SUNRPC: Reduce rpciod workqueue contention Chuck Lever
2026-09-02 20:40   ` Tim Menninger
2026-09-03 13:33     ` Chuck Lever
2026-09-03 23:50       ` Tim Menninger
2026-09-04 14:13         ` Chuck Lever
2026-09-04 23:23           ` Tim Menninger
2026-09-06 16:21             ` Chuck Lever
2026-09-08 18:19               ` tmenninger
2026-09-08 21:11                 ` Chuck Lever
2026-09-08 23:39                   ` tmenninger
2026-09-09 16:14                     ` Chuck Lever
2026-09-12 14:59                       ` tmenninger [this message]
2026-09-12 15:49                         ` Chuck Lever
2026-09-13 13:13                           ` tmenninger
2026-09-13 16:40                             ` Chuck Lever
2026-09-14 17:39                               ` tmenninger
2026-09-15 14:42                                 ` Chuck Lever
2026-09-16 23:25                                   ` Tim Menninger
2026-08-31 18:22 ` [PATCH RFC 7/8] NFS: Reduce nfsiod " Chuck Lever
2026-08-31 18:22 ` [PATCH RFC 8/8] SUNRPC: Reduce xprtiod " Chuck Lever

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=20260912145926.208269-1-tmenninger@purestorage.com \
    --to=tmenninger@purestorage.com \
    --cc=anna@kernel.org \
    --cc=cel@kernel.org \
    --cc=ebadger@everpuredata.com \
    --cc=jcurley@everpuredata.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tj@kernel.org \
    --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

all inboxes | Powered by JetHome®