From: Dennis Zhou <dennis@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@linux.com>,
Mateusz Guzik <mjguzik@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL] percpu changes for v6.6-rc1
Date: Wed, 30 Aug 2023 17:10:05 -0700 [thread overview]
Message-ID: <ZO/aXSBuVRuqFHtz@snowbird> (raw)
Hi Linus,
There is 1 bigger change to percpu_counter's api allowing for init and
destroy of multiple counters via percpu_counter_init_many() and
percpu_counter_destroy_many(). This is used to help begin remediating a
performance regression with percpu rss stats.
Additionally, it seems larger core count machines are feeling the burden
of the single threaded allocation of percpu. Mateusz is thinking about
it and I will spend some time on it too.
Thanks,
Dennis
The following changes since commit 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4:
Linux 6.5-rc4 (2023-07-30 13:23:47 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu.git tags/percpu-for-6.6
for you to fetch changes up to 14ef95be6f5558fb9e43aaf06ef9a1d6e0cae6c8:
kernel/fork: group allocation/free of per-cpu counters for mm struct (2023-08-25 08:10:35 -0700)
----------------------------------------------------------------
percpu: changes for v6.6
percpu
* A couple cleanups by Baoquan He and Bibo Mao. The only behavior change
is to start printing messages if we're under the warn limit for failed
atomic allocations.
percpu_counter
* Shakeel introduced percpu counters into mm_struct which caused percpu
allocations be on the hot path [1]. Originally I spent some time
trying to improve the percpu allocator, but instead preferred what
Mateusz Guzik proposed grouping at the allocation site,
percpu_counter_init_many(). This allows a single percpu allocation to
be shared by the counters. I like this approach because it creates a
shared lifetime by the allocations. Additionally, I believe many inits
have higher level synchronization requirements, like percpu_counter
does against HOTPLUG_CPU. Therefore we can group these optimizations
together.
[1] https://lore.kernel.org/linux-mm/20221024052841.3291983-1-shakeelb@google.com/
----------------------------------------------------------------
Baoquan He (3):
mm/percpu.c: remove redundant check
mm/percpu.c: optimize the code in pcpu_setup_first_chunk() a little bit
mm/percpu.c: print error message too if atomic alloc failed
Bibo Mao (1):
mm/percpu: Remove some local variables in pcpu_populate_pte
Mateusz Guzik (2):
pcpcntr: add group allocation/free
kernel/fork: group allocation/free of per-cpu counters for mm struct
include/linux/percpu_counter.h | 41 ++++++++++++++++++++-----
kernel/fork.c | 15 +++------
lib/percpu_counter.c | 62 +++++++++++++++++++++++++------------
mm/percpu.c | 69 +++++++++++++++++-------------------------
4 files changed, 109 insertions(+), 78 deletions(-)
next reply other threads:[~2023-08-31 0:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 0:10 Dennis Zhou [this message]
2023-09-01 23:19 ` [GIT PULL] percpu changes for v6.6-rc1 pr-tracker-bot
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=ZO/aXSBuVRuqFHtz@snowbird \
--to=dennis@kernel.org \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mjguzik@gmail.com \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).