From: "Garg, Shivank" <shivankg@amd.com>
To: "vbabka@kernel.org" <vbabka@kernel.org>,
"harry@kernel.org" <harry@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: "cl@gentwo.org" <cl@gentwo.org>,
"edumazet@kernel.org" <edumazet@kernel.org>,
"pfalcato@suse.de" <pfalcato@suse.de>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"hao.li@linux.dev" <hao.li@linux.dev>,
"surenb@google.com" <surenb@google.com>,
"Salunke, Hrushikesh" <Hrushikesh.Salunke@amd.com>,
"ming.lei@redhat.com" <ming.lei@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"regressions@lists.linux.dev" <regressions@lists.linux.dev>,
"Rao, Bharata Bhasker" <bharata@amd.com>,
"roman.gushchin@linux.dev" <roman.gushchin@linux.dev>,
"rientjes@google.com" <rientjes@google.com>
Subject: [REGRESSION] slab: Redis loopback throughput drops 40% after the sheaves merge, list_lock contention
Date: Fri, 4 Dec 2026 08:18:18 +0000 [thread overview]
Message-ID: <7c4f1dab201fbefbd318058cd9c7640b76af4d5b.camel@amd.com> (raw)
Hi,
On a 2-socket AMD EPYC Zen 6 system, a Redis/memtier benchmark over
loopback TCP loses about 40% of its throughput with the slab-for-7.0
merge (148f95f75c51) and has not recovered as of v7.4-rc4.
Hao Li's slab parking RFC [1] recovers most of the throughput, but the
refill side still contends on that lock. Pedro asked in that thread why
the slow paths are hit so hard [2]; this workload may be a useful data
point.
Kernels:
K1: 41f1a08645ab (just before the slab-for-7.0 merge)
K2: 148f95f75c51 (Merge tag 'slab-for-7.0')
K3: v7.4-rc4
K4: v7.4-rc4 + slab parking RFC 2/2 [1]
The cache-aware scheduler (CONFIG_SCHED_CACHE, llc_balancing) was added
in v7.2 and changes the scores of K3 and K4, so both settings of
/sys/kernel/debug/sched/llc_balancing/enabled are shown. K1 and K2 do
not have it.
Results (128 Redis instances, ops/s, higher is better)
------------------------------------------------------
kernel score imbalance
K1 35.3M 4-6%
K2 21.2M 2%
llc_balancing off llc_balancing on
K3 18.1M 4% 20.9M 3%
K4 31.1M 16-19% 34.0M 5-8%
Imbalance = 1 - (slowest instance / average instance), i.e. how far
the slowest Redis instance falls behind the average one. K3 and K4
were measured in the same session, two runs each.
The drop in score comes from e323b52cf00f ("slab: remove SLUB_CPU_PARTIAL"),
where allocation stops using CPU slabs.
The workload do not have to cross sockets to see regression.
With each memtier on node 1 (the servers' socket) instead of node 2,
llc_balancing off:
cross-socket same socket
K1 (+026dfef287c0) 35.5M 43.3M
K3 18.5M 22.7M
K4 31.1M 42.7M
(Without 026dfef287c0 "tcp: give up on stronger sk_rcvbuf checks (for
now)", two clients hang in warm-up on K1 in this placement.)
IBS profiles
------------
perf record -e ibs_op// -F 99 -g for 30 s during the measured phase, on
the server CPUs and the client node:
Share of all samples by the call path that took the lock:
K1 K2 K3 K4
native_queued_spin_lock_slowpath 0.26% 49.6% 51.0% 7.4%
__slab_free (from tcp_ack) 0.00% 19.6% 23.2% 0.0%
__refill_objects_node 0.00% 13.8% 21.8% 6.5%
__slab_free (from refill) 0.00% 9.4% 0.0% 0.0%
lock_sock 0.21% 6.5% 6.0% 0.9%
perf lock contention -ab -l for 60 s, in a separate run (scores are
6-10% lower while tracing). Contentions and wait time summed over the
kmem_cache_node locks; average and maximum wait for the busiest one:
contended total wait avg wait max wait
K1 42.5K 0.50 s 12 us 38 us
K2 26.9M 2.44 h 333 us 512 us
K3 28.9M 2.36 h 304 us 498 us
K4 16.6M 0.60 h 171 us 1.35 ms
SLUB stats
----------
Raw deltas of /sys/kernel/slab/<cache>/<stat> between two snapshots
taken around the 30 s IBS recording, for the three caches that carry
nearly all slab traffic here (every other cache is about 1000x smaller).
Counters that stayed zero on all four kernels are omitted;
K1 K2 K3 K4
window (s) 46.6 46.7 45.6 45.7
score (ops/s) 35478084 20686973 18704350 30338628
skbuff_small_head
alloc_fastpath 858637817 501674273 451686818 777803866
alloc_slowpath 20533599 402533 0 0
free_fastpath 362550811 298845067 264494949 468618930
free_slowpath 516620401 203233941 187193140 309184878
free_frozen 291872511 0 0 0
free_add_partial 2508876 16366857 12554973 20654336
free_remove_partial 473 15 3 84
alloc_from_partial 908862 0 0 0
alloc_slab 865539 16 0 82
alloc_refill 15614960 0 0 0
free_slab 865505 15 3 84
deactivate_empty 865041 0 0 0
deactivate_bypass 4918651 0 0 0
cmpxchg_double_cpu_fail 1 0 0 0
cmpxchg_double_fail 7046923 8985001 9870156 4350514
cpu_partial_alloc 3144255 0 0 0
cpu_partial_free 4918642 0 0 0
cpu_partial_node 1599546 0 0 0
cpu_partial_drain 1124639 0 0 0
sheaf_flush 0 84 0 308
sheaf_refill 0 202831496 187193972 309185436
sheaf_alloc 0 1 1 0
barn_get 0 1735293 1192686 513887
barn_get_fail 0 7646517 6685533 11042351
barn_put 0 1735288 1192679 513886
barn_put_fail 0 3 0 11
skbuff_fclone_cache (merged by SLUB into :0000512 with pool_workqueue,
sgpool-16 and others; counters are for the whole
merged cache)
alloc_fastpath 811658540 472356054 419678959 712136406
alloc_slowpath 12159236 8 0 0
free_fastpath 428713955 272135099 234237555 418284975
free_slowpath 395104003 200220715 185442322 293851863
free_frozen 391353926 0 0 0
free_add_partial 31450 12394163 9752769 11922064
free_remove_partial 90 10 6 36
alloc_from_partial 12318 0 0 0
alloc_slab 4384 13 3 39
alloc_refill 12100009 0 0 0
alloc_node_mismatch 7 7 0 0
free_slab 4417 10 6 36
deactivate_empty 4327 0 0 0
deactivate_to_head 6 0 0 0
deactivate_to_tail 1 0 0 0
deactivate_remote_frees 1 0 0 0
deactivate_bypass 59266 0 0 0
cmpxchg_double_cpu_fail 1 0 0 0
cmpxchg_double_fail 133519 510080 803684 2407007
cpu_partial_alloc 42578 0 0 0
cpu_partial_free 59266 0 0 0
cpu_partial_node 19054 0 0 0
cpu_partial_drain 17885 0 0 0
sheaf_refill 0 200221112 185442404 293852272
sheaf_alloc 0 7 5 2
barn_get 0 899214 593667 258897
barn_get_fail 0 7150760 6622971 10494696
barn_put 0 899225 593666 258895
skbuff_head_cache
alloc_fastpath 55537635 26508172 32025447 64377421
alloc_slowpath 16513 3045585 0 0
free_fastpath 54497205 26508028 30208694 49095037
free_slowpath 1056943 3045710 1816671 15282404
free_frozen 1056701 0 0 0
free_add_partial 2 46117 22579 310801
alloc_refill 16512 0 0 0
deactivate_bypass 4 0 0 0
cmpxchg_double_fail 2 84247 352 14362
cpu_partial_alloc 4 0 0 0
cpu_partial_free 4 0 0 0
cpu_partial_drain 1 0 0 0
free_remove_partial 0 2 1 4
free_slab 0 2 1 4
barn_get 0 19 4 4
barn_get_fail 0 3045628 64877 545801
barn_put 0 17 2 3
sheaf_refill 0 0 1816556 15282260
Setup
-----
Machine: AMD EPYC Zen 6, 2-socket, 256 cores per socket, SMT2, NPS2.
8 CCDs per socket, 32 cores per CCD. Core clock fixed at
2.0 GHz.
NUMA node0 CPU(s): 0-127,512-639 (socket 0)
NUMA node1 CPU(s): 128-255,640-767 (socket 0)
NUMA node2 CPU(s): 256-383,768-895 (socket 1)
NUMA node3 CPU(s): 384-511,896-1023 (socket 1)
node distances:
node 0 1 2 3
0: 10 12 32 32
1: 12 10 32 32
2: 32 32 10 12
3: 32 32 12 10
Kernels: the mainline commits listed above.
Default systemd cgroup layout, no memory limits.
Workload: Redis 7.0.11 and memtier_benchmark 2.1.2 over loopback TCP.
128 redis-servers, one per core on cores 0-127 (node 0); one
memtier per server, allowed anywhere in node 2 (socket 1).
Server i (i = 0..127):
numactl -C $i -m 0 -- redis-server redis.conf --save "" \
--port $((6300+i))
(redis.conf: bind 127.0.0.1, appendonly no)
Client i, warm-up:
numactl -C 256-383,768-895 -m 2 -- \
memtier_benchmark -s 127.0.0.1 --port $((6300+i)) \
-n allkeys --data-size=2048 --key-prefix A \
--key-minimum=1 --key-maximum=8000000 \
--key-pattern G:G --key-stddev=180000 \
--distinct-client-seed -c 2 -t 2 --pipeline 150 \
--ratio=1:0
Client i, measured (120 s): the same with --test-time 120
--ratio=1:10 instead of -n allkeys --ratio=1:0
Score: sum of the Ops/sec on each memtier's "Totals" line.
Is there a plan for reviving the parking patchset[1] or any other fix to
target this issue. I am happy to test patches or collect more data on this
system.
[1] https://lore.kernel.org/all/20260824122513.3829-2-hao.li@linux.dev/
[2] https://lore.kernel.org/all/apBioBxd4VkmaGhA@pedro-suse/
Thanks,
Shivank
next reply other threads:[~2026-12-04 8:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 8:18 Garg, Shivank [this message]
2026-12-04 9:37 ` [REGRESSION] slab: Redis loopback throughput drops 40% after the sheaves merge, list_lock contention Hao Li
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=7c4f1dab201fbefbd318058cd9c7640b76af4d5b.camel@amd.com \
--to=shivankg@amd.com \
--cc=Hrushikesh.Salunke@amd.com \
--cc=akpm@linux-foundation.org \
--cc=bharata@amd.com \
--cc=cl@gentwo.org \
--cc=edumazet@kernel.org \
--cc=hao.li@linux.dev \
--cc=harry@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ming.lei@redhat.com \
--cc=pfalcato@suse.de \
--cc=regressions@lists.linux.dev \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=surenb@google.com \
--cc=vbabka@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