Skip to contentSkip to conversation

stackdepot-use-variable-size-records-for-non-evictable-entries.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Feb 24, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: stackdepot: use variable size records for non-evictable entries
has been removed from the -mm tree. Its filename was
stackdepot-use-variable-size-records-for-non-evictable-entries.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Marco Elver <[email protected]>
Subject: stackdepot: use variable size records for non-evictable entries
Date: Mon, 29 Jan 2024 11:07:01 +0100

With the introduction of stack depot evictions, each stack record is now fixed size, so that future reuse after an eviction can safely store differently sized stack traces. In all cases that do not make use of evictions, this wastes lots of space.

Fix it by re-introducing variable size stack records (up to the max allowed size) for entries that will never be evicted. We know if an entry will never be evicted if the flag STACK_DEPOT_FLAG_GET is not provided, since a later stack_depot_put() attempt is undefined behavior.

With my current kernel config that enables KASAN and also SLUB owner tracking, I observe (after a kernel boot) a whopping reduction of 296 stack depot pools, which translates into 4736 KiB saved. The savings here are from SLUB owner tracking only, because KASAN generic mode still uses refcounting.

Before:

pools: 893
allocations: 29841
frees: 6524
in_use: 23317
freelist_size: 3454

After:

pools: 597
refcounted_allocations: 17547
refcounted_frees: 6477
refcounted_in_use: 11070
freelist_size: 3497
persistent_count: 12163
persistent_bytes: 1717008

---

 include/linux/poison.h |    3 
 lib/stackdepot.c       |  250 +++++++++++++++++++--------------------
 2 files changed, 130 insertions(+), 123 deletions(-)
include/linux/poison.h renamed from include/linux/poison.h~stackdepot-use-variable-size-records-for-non-evictable-entries +3 -0
@@ -92,4 +92,7 @@
 /********** VFS **********/
 #define VFS_PTR_POISON ((void *)(0xF5 + POISON_POINTER_DELTA))
 
+/********** lib/stackdepot.c **********/
+#define STACK_DEPOT_POISON ((void *)(0xD390 + POISON_POINTER_DELTA))
+
 #endif
lib/stackdepot.c renamed from lib/stackdepot.c~stackdepot-use-variable-size-records-for-non-evictable-entries +127 -123

379 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are