From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: John Johansen <john.johansen@canonical.com>,
Swapnil Sapkal <Swapnil.Sapkal@amd.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
Aaron Lu <aaron.lu@intel.com>,
x86@kernel.org, Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [tip: sched/core] sched: Fix performance regression introduced by mm_cid
Date: Fri, 23 Jun 2023 08:52:34 +0200 [thread overview]
Message-ID: <20230623065234.ci6_7ob6@linutronix.de> (raw)
In-Reply-To: <287c33e1-acb7-62db-7267-227cbcc54707@efficios.com>
On 2023-06-22 10:33:13 [-0400], Mathieu Desnoyers wrote:
>
> What was fundamentally wrong with the per-cpu caches before commit
> df323337e50 other than being non-RT friendly ? Was the only purpose of that
> commit to reduce the duration of preempt-off critical sections, or is there
> a bigger picture concern it was taking care of by introducing a global pool
> ?
There were memory allocations within preempt-disabled sections
introduced by get_cpu_ptr(). This didn't fly on PREEMPT_RT. After
looking at this on 2 node, 64 CPUs box I didn't get anywhere near
complete usage of the allocated buffers per-CPU buffers. It looked
wasteful.
Based on my testing back then, it looked sufficient to use a global
buffer.
> Introducing per-cpu memory pools, dealing with migration by giving entries
> back to the right cpu's pool, taking into account the cpu the entry belongs
> to, and use a per-cpu/lock-free data structure allowing lock-free push to
> give back an entry on a remote cpu should do the trick without locking, and
> without long preempt-off critical sections.
>
> The only downside I see for per-cpu memory pools is a slightly larger memory
> overhead on large multi-core systems. But is that really a concern ?
Yes, if the memory is left unused and can't be reclaimed if needed.
> What am I missing here ?
I added (tried to add) an people claimed that the SLUB allocated got
better over the years. Also on NUMA systems it might be better to use it
since the memory is NUMA local. The allocation is for 8KiB by default.
Is there a test-case/ benchmark I could try this vs kmalloc()?
> Thanks,
>
> Mathieu
Sebastian
next prev parent reply other threads:[~2023-06-23 6:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-22 7:43 [tip: sched/core] sched: Fix performance regression introduced by mm_cid tip-bot2 for Mathieu Desnoyers
2023-06-20 8:14 ` Swapnil Sapkal
2023-06-20 9:11 ` Peter Zijlstra
2023-06-20 10:35 ` Swapnil Sapkal
2023-06-20 10:51 ` Mathieu Desnoyers
2023-06-21 16:36 ` Swapnil Sapkal
2023-06-21 18:51 ` Mathieu Desnoyers
2023-06-21 21:41 ` Mathieu Desnoyers
2023-06-21 23:59 ` John Johansen
2023-06-22 14:33 ` Mathieu Desnoyers
2023-06-22 16:09 ` John Johansen
2023-06-23 6:52 ` Sebastian Andrzej Siewior [this message]
2023-06-23 6:37 ` Sebastian Andrzej Siewior
2023-06-23 7:16 ` John Johansen
2023-06-23 8:15 ` Sebastian Andrzej Siewior
2023-06-23 7:35 ` John Johansen
2023-06-23 8:17 ` Sebastian Andrzej Siewior
2023-07-14 6:02 ` Swapnil Sapkal
2023-07-14 14:55 ` Mathieu Desnoyers
2023-07-18 6:01 ` Swapnil Sapkal
2023-06-23 13:12 ` Linux regression tracking #adding (Thorsten Leemhuis)
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=20230623065234.ci6_7ob6@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=Swapnil.Sapkal@amd.com \
--cc=aaron.lu@intel.com \
--cc=akpm@linux-foundation.org \
--cc=john.johansen@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@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