From: Noam Stolero <noams@mellanox.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>,
Matthew Wilcox <willy@infradead.org>, Qian Cai <cai@lca.pw>,
Tal Gilboa <talgi@mellanox.com>,
Tariq Toukan <tariqt@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>,
Amir Ancel <amira@mellanox.com>, Matan Nir <matann@mellanox.com>,
Bar Tuaf <bartu@mellanox.com>,
"brouer@redhat.com" <brouer@redhat.com>,
"edumazet@google.com" <edumazet@google.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH v3 0/3] mm: kmemleak: Use a memory pool for kmemleak object allocations
Date: Tue, 3 Dec 2019 15:51:50 +0000 [thread overview]
Message-ID: <08847a90-c37b-890f-8d0e-3ae1c3a1dd71@mellanox.com> (raw)
In-Reply-To: <20190812160642.52134-1-catalin.marinas@arm.com>
[-- Attachment #1.1: Type: text/plain, Size: 2586 bytes --]
On 8/12/2019 7:06 PM, Catalin Marinas wrote:
Following the discussions on v2 of this patch(set) [1], this series
takes slightly different approach:
- it implements its own simple memory pool that does not rely on the
slab allocator
- drops the early log buffer logic entirely since it can now allocate
metadata from the memory pool directly before kmemleak is fully
initialised
- CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE option is renamed to
CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE
- moves the kmemleak_init() call earlier (mm_init())
- to avoid a separate memory pool for struct scan_area, it makes the
tool robust when such allocations fail as scan areas are rather an
optimisation
[1] http://lkml.kernel.org/r/20190727132334.9184-1-catalin.marinas@arm.com
Catalin Marinas (3):
mm: kmemleak: Make the tool tolerant to struct scan_area allocation
failures
mm: kmemleak: Simple memory allocation pool for kmemleak objects
mm: kmemleak: Use the memory pool for early allocations
init/main.c | 2 +-
lib/Kconfig.debug | 11 +-
mm/kmemleak.c | 325 ++++++++++++----------------------------------
3 files changed, 91 insertions(+), 247 deletions(-)
Hi Catalin,
We observe severe degradation in our network performance affecting all of our NICs.
The degradation is directly linked to this patch.
What we run:
Simple Iperf TCP loopback with 8 streams on ConnectX5-100GbE.
Since it's a loopback test, traffic goes from the socket through the IP
stack and back to the socket, without going through the NIC driver.
What we observe:
Throughput performance:
- Kernel 5.3GA - Throughput was 230Gbps
- Kernel 5.4-rc1 and later - Throughput is 50Gbps
CPU utilization-wise:
Using perf we see much higher CPU utilization with kmem related functions:
Function | Kernel 5.3GA | Kernel 5.4-rc1 and later
--------------------------|--------------|-------------------------
__kfree_skb | 3.4% | 11.0%
kmem_cache_free | 0.3% | 10.2%
__alloc_skb | 2.2% | 26.0%
queued_spin_lock_slowpath | 1.3% | 26.3%
delete_object_full | Not used | 18.0%
'delete_object_full()' function seems like the one which starts the slower flow.
One of the conditions causing this function to kick into action is 'kmemleak_free_enabled' flag,
which was changed to enabled by default by your series.
Reverting discussed series restore the performance almost completely.
Can you help shed light on the subject?
[-- Attachment #1.2: Type: text/html, Size: 3818 bytes --]
[-- Attachment #2: perf_record_loopback_8_streams_k5.3_FG.svg --]
[-- Type: image/svg+xml, Size: 402088 bytes --]
[-- Attachment #3: perf_record_loopback_8_streams_k5.4_FG.svg --]
[-- Type: image/svg+xml, Size: 539302 bytes --]
next prev parent reply other threads:[~2019-12-03 15:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-12 16:06 Catalin Marinas
2019-08-12 16:06 ` [PATCH v3 1/3] mm: kmemleak: Make the tool tolerant to struct scan_area allocation failures Catalin Marinas
[not found] ` <2ac37341-097e-17a2-fb6b-7912da9fa38e@ozlabs.ru>
2019-10-03 8:41 ` Catalin Marinas
[not found] ` <ba47fb68-f44c-04c9-7ea8-2705e799937b@ozlabs.ru>
2019-10-07 9:56 ` Catalin Marinas
2019-08-12 16:06 ` [PATCH v3 2/3] mm: kmemleak: Simple memory allocation pool for kmemleak objects Catalin Marinas
2019-08-13 9:37 ` Catalin Marinas
2019-08-12 16:06 ` [PATCH v3 3/3] mm: kmemleak: Use the memory pool for early allocations Catalin Marinas
2019-08-13 9:35 ` Catalin Marinas
2019-08-13 12:35 ` Qian Cai
2019-08-13 13:49 ` Catalin Marinas
2019-08-12 21:07 ` [PATCH v3 0/3] mm: kmemleak: Use a memory pool for kmemleak object allocations Andrew Morton
2019-08-13 9:40 ` Catalin Marinas
2019-12-03 15:51 ` Noam Stolero [this message]
2019-12-03 16:08 ` Catalin Marinas
2019-12-05 16:16 ` Noam Stolero
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=08847a90-c37b-890f-8d0e-3ae1c3a1dd71@mellanox.com \
--to=noams@mellanox.com \
--cc=akpm@linux-foundation.org \
--cc=amira@mellanox.com \
--cc=bartu@mellanox.com \
--cc=brouer@redhat.com \
--cc=cai@lca.pw \
--cc=catalin.marinas@arm.com \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matann@mellanox.com \
--cc=mhocko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=talgi@mellanox.com \
--cc=tariqt@mellanox.com \
--cc=willy@infradead.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