From: Waiman Long <longman@redhat.com>
To: Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>,
Johannes Weiner <hannes@cmpxchg.org>
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
Joe Mario <jmario@redhat.com>, Sebastian Jug <sejug@redhat.com>,
Yosry Ahmed <yosryahmed@google.com>,
Waiman Long <longman@redhat.com>
Subject: [PATCH v4 0/3] cgroup/rstat: Reduce cpu_lock hold time in cgroup_rstat_flush_locked()
Date: Mon, 6 Nov 2023 16:05:40 -0500 [thread overview]
Message-ID: <20231106210543.717486-1-longman@redhat.com> (raw)
v4:
- Update patch 2 to fix a minor bug and update some of the comments.
v3:
- Minor comment twisting as suggested by Yosry.
- Add patches 2 and 3 to further reduce lock hold time
The purpose of this patch series is to reduce of the cpu_lock hold time
in cgroup_rstat_flush_locked() so as to reduce the latency impact when
cgroup_rstat_updated() is called as they may contend with each other
on the cpu_lock.
A parallel kernel build on a 2-socket x86-64 server is used as the
benchmarking tool for measuring the lock hold time. Below were the lock
hold time frequency distribution before and after applying different
number of patches:
Hold time Before patch Patch 1 Patches 1-2 Patches 1-3
--------- ------------ ------- ----------- -----------
0-01 us 804,139 13,738,708 14,594,545 15,484,707
01-05 us 9,772,767 1,177,194 439,926 207,382
05-10 us 4,595,028 4,984 5,960 3,174
10-15 us 303,481 3,562 3,543 3,006
15-20 us 78,971 1,314 1,397 1,066
20-25 us 24,583 18 25 15
25-30 us 6,908 12 12 10
30-40 us 8,015
40-50 us 2,192
50-60 us 316
60-70 us 43
70-80 us 7
80-90 us 2
>90 us 3
Waiman Long (3):
cgroup/rstat: Reduce cpu_lock hold time in cgroup_rstat_flush_locked()
cgroup/rstat: Optimize cgroup_rstat_updated_list()
cgroup: Avoid false cacheline sharing of read mostly rstat_cpu
include/linux/cgroup-defs.h | 14 ++++
kernel/cgroup/rstat.c | 131 +++++++++++++++++++++---------------
2 files changed, 91 insertions(+), 54 deletions(-)
--
2.39.3
next reply other threads:[~2023-11-06 21:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 21:05 Waiman Long [this message]
2023-11-06 21:05 ` [PATCH v4 1/3] cgroup/rstat: Reduce cpu_lock hold time in cgroup_rstat_flush_locked() Waiman Long
2023-11-06 21:05 ` [PATCH v4 2/3] cgroup/rstat: Optimize cgroup_rstat_updated_list() Waiman Long
2023-11-28 4:01 ` Waiman Long
2023-11-28 16:43 ` Tejun Heo
2023-11-28 16:46 ` Waiman Long
2023-11-06 21:05 ` [PATCH v4 3/3] cgroup: Avoid false cacheline sharing of read mostly rstat_cpu Waiman Long
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=20231106210543.717486-1-longman@redhat.com \
--to=longman@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jmario@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=sejug@redhat.com \
--cc=tj@kernel.org \
--cc=yosryahmed@google.com \
/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;
as well as URLs for NNTP newsgroup(s).