Re: [SLUB] nfs_page cmpxchg_double_fail and perf lock perturbation on dual-socket NFS/RDMA
From: Tim Menninger
Date: Mon Sep 21 2026 - 19:30:18 EST
> Did any of that change with slab_nomerge?
No. The large change in the SLUB counters still reproduced with
slab_nomerge when using perf lock record. For example:
uninstrumented perf lock record
unpinned/node0
free_fastpath 75,366,487 646,378,908
free_slowpath 41,594,255 259,704,037
node0/node0
free_fastpath 119,705,541 440,896,371
free_slowpath 6,344 6,679,339
unpinned/balanced
free_fastpath 59,404,047 384,715,890
free_slowpath 60,602,379 324,936,304
> ... unless perf lock was writing data to an NFS filesystem?
It was not. The perf data file was on the local root filesystem:
$ df -T linux-mm/
Filesystem Type
/dev/mapper/ubuntu--vg-ubuntu--lv ext4
> You can use the BPF version of perf lock to check lock contention like
> below. (it only work with 'contention' subcommand.)
>
> $ sudo perf lock con -ab sleep 10
>
> or
>
> $ sudo perf lock con -ab -E 5 sleep 10
I reran the three placement cases using the BPF version, aggregating
by lock address:
sudo perf lock con -abl -E 5 -- sleep 10
I ran only perf lock and mpstat concurrently.
The BPF version is substantially less disruptive. Comparing adjacent
10-second uninstrumented and instrumented windows:
uninstrumented BPF perf lock
unpinned/node0
throughput 45.5 GB/s 43-44 GB/s
free_fastpath 76,217,260 118,511,381
free_slowpath 39,962,005 22,717,811
cmpxchg_double_fail 9,299 9,587
system idle 22.74% 10.61%
node0/node0
throughput 46.5 GB/s 46.5 GB/s
free_fastpath 119,739,790 148,686,356
free_slowpath 5,686 8,791
cmpxchg_double_fail 1,483 3,170
system idle 83.33% 82.42%
unpinned/balanced
throughput 46.5 GB/s 46.5 GB/s
free_fastpath 59,341,738 92,824,030
free_slowpath 60,000,396 60,658,896
cmpxchg_double_fail 1,742 23,772
system idle 68.27% 50.03%
The per-lock-address BPF results are also quite different from the
perf lock record results:
unpinned/node0:
contended total wait avg wait address
8,345,025 12.27 min 88.23 us ff3ad60e50e85100
node0/node0:
contended total wait avg wait address
6,461,976 30.70 sec 4.75 us ff3ad58ecf36ac80
unpinned/balanced:
contended total wait avg wait address
6,592,568 6.50 min 59.18 us ff3ad60e50e85100
143,397 666.98 ms 4.65 us ff3ad58ecf36ac80
perf identifies these as kmem_cache_node spinlocks.