[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca46435a-f67a-4d85-bf8d-b5d3289b6185@redhat.com>
Date: Fri, 3 May 2024 10:30:02 -0400
From: Waiman Long <longman@...hat.com>
To: Jesper Dangaard Brouer <hawk@...nel.org>, tj@...nel.org,
hannes@...xchg.org, lizefan.x@...edance.com, cgroups@...r.kernel.org,
yosryahmed@...gle.com
Cc: netdev@...r.kernel.org, linux-mm@...ck.org, shakeel.butt@...ux.dev,
kernel-team@...udflare.com, Arnaldo Carvalho de Melo <acme@...nel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: [PATCH v1] cgroup/rstat: add cgroup_rstat_cpu_lock helpers and
tracepoints
On 5/3/24 10:00, Jesper Dangaard Brouer wrote:
>> I may have mistakenly thinking the lock hold time refers to just the
>> cpu_lock. Your reported times here are about the cgroup_rstat_lock.
>> Right? If so, the numbers make sense to me.
>>
>
> True, my reported number here are about the cgroup_rstat_lock.
> Glad to hear, we are more aligned then 🙂
>
> Given I just got some prod machines online with this patch
> cgroup_rstat_cpu_lock tracepoints, I can give you some early results,
> about hold-time for the cgroup_rstat_cpu_lock.
>
> From this oneliner bpftrace commands:
>
> Â sudo bpftrace -e '
> Â Â Â Â Â Â Â Â tracepoint:cgroup:cgroup_rstat_cpu_lock_contended {
> Â Â Â Â Â Â Â Â Â Â @start[tid]=nsecs; @cnt[probe]=count()}
> Â Â Â Â Â Â Â Â tracepoint:cgroup:cgroup_rstat_cpu_locked {
> Â Â Â Â Â Â Â Â Â Â $now=nsecs;
> Â Â Â Â Â Â Â Â Â Â if (args->contended) {
> Â Â Â Â Â Â Â Â Â Â Â Â @wait_per_cpu_ns=hist($now-@...rt[tid]);
> delete(@start[tid]);}
> Â Â Â Â Â Â Â Â Â Â @cnt[probe]=count(); @locked[tid]=$now}
> Â Â Â Â Â Â Â Â tracepoint:cgroup:cgroup_rstat_cpu_unlock {
> Â Â Â Â Â Â Â Â Â Â $now=nsecs;
> Â Â Â Â Â Â Â Â Â Â @locked_per_cpu_ns=hist($now-@...ked[tid]);
> delete(@locked[tid]);
> Â Â Â Â Â Â Â Â Â Â @cnt[probe]=count()}
> Â Â Â Â Â Â Â Â interval:s:1 {time("%H:%M:%S "); print(@wait_per_cpu_ns);
> Â Â Â Â Â Â Â Â Â Â print(@locked_per_cpu_ns); print(@cnt); clear(@cnt);}'
>
> Results from one 1 sec period:
>
> 13:39:55 @wait_per_cpu_ns:
> [512, 1K)Â Â Â Â Â Â Â Â Â Â Â Â Â 3 | Â Â Â Â |
> [1K, 2K)Â Â Â Â Â Â Â Â Â Â Â Â Â 12 |@ Â Â Â Â |
> [2K, 4K)Â Â Â Â Â Â Â Â Â Â Â Â 390
> |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
> [4K, 8K)Â Â Â Â Â Â Â Â Â Â Â Â Â 70 |@@@@@@@@@ Â Â Â Â |
> [8K, 16K)Â Â Â Â Â Â Â Â Â Â Â Â 24 |@@@ Â Â Â Â |
> [16K, 32K)Â Â Â Â Â Â Â Â Â Â 183 |@@@@@@@@@@@@@@@@@@@@@@@@ Â Â Â Â |
> [32K, 64K)Â Â Â Â Â Â Â Â Â Â Â 11 |@ Â Â Â Â |
>
> @locked_per_cpu_ns:
> [256, 512)Â Â Â Â Â Â Â Â 75592 |@ Â Â Â Â |
> [512, 1K)Â Â Â Â Â Â Â 2537357
> |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
> [1K, 2K)Â Â Â Â Â Â Â Â Â 528615 |@@@@@@@@@@ Â Â Â Â |
> [2K, 4K)Â Â Â Â Â Â Â Â Â 168519 |@@@ Â Â Â Â |
> [4K, 8K)Â Â Â Â Â Â Â Â Â 162039 |@@@ Â Â Â Â |
> [8K, 16K)Â Â Â Â Â Â Â Â 100730 |@@ Â Â Â Â |
> [16K, 32K)Â Â Â Â Â Â Â Â 42276 | Â Â Â Â |
> [32K, 64K)Â Â Â Â Â Â Â Â Â 1423 | Â Â Â Â |
> [64K, 128K)Â Â Â Â Â Â Â Â Â Â 89 | Â Â Â Â |
>
> Â @cnt[tracepoint:cgroup:cgroup_rstat_cpu_lock_contended]: 3 /sec
> Â @cnt[tracepoint:cgroup:cgroup_rstat_cpu_unlock]: 3200Â /sec
> Â @cnt[tracepoint:cgroup:cgroup_rstat_cpu_locked]: 3200Â /sec
>
>
> So, we see "flush-code-path" per-CPU-holding @locked_per_cpu_ns isn't
> exceeding 128 usec.
>
> My latency requirements, to avoid RX-queue overflow, with 1024 slots,
> running at 25 Gbit/s, is 27.6 usec with small packets, and 500 usec
> (0.5ms) with MTU size packets. This is very close to my latency
> requirements.
Thanks for sharing the data.
This is more aligned with what I would have expected. Still, a high up
to 128 usec is still on the high side. I remembered during my latency
testing when I worked on cpu_lock latency patch, it was in the 2 digit
range. Perhaps there are other sources of noise or the update list is
really long. Anyway, it may be a bit hard to reach the 27.6 usec target
for small packets.
Cheers,
Longman
Powered by blists - more mailing lists