Skip to contentSkip to conversation

lib-stackdepot-store-next-pool-pointer-in-new_pool.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Dec 11, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: lib/stackdepot: store next pool pointer in new_pool
has been removed from the -mm tree. Its filename was
lib-stackdepot-store-next-pool-pointer-in-new_pool.patch

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

------------------------------------------------------
From: Andrey Konovalov <[email protected]>
Subject: lib/stackdepot: store next pool pointer in new_pool
Date: Mon, 20 Nov 2023 18:47:08 +0100

Instead of using the last pointer in stack_pools for storing the pointer to a new pool (which does not yet store any stack records), use a new new_pool variable.

This a purely code readability change: it seems more logical to store the pointer to a pool with a special meaning in a dedicated variable.

---

 lib/stackdepot.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
lib/stackdepot.c renamed from lib/stackdepot.c~lib-stackdepot-store-next-pool-pointer-in-new_pool +5 -1
@@ -85,6 +85,8 @@ static unsigned int stack_hash_mask;
 
 /* Array of memory regions that store stack traces. */
 static void *stack_pools[DEPOT_MAX_POOLS];
+/* Newly allocated pool that is not yet added to stack_pools. */
+static void *new_pool;
 /* Currently used pool in stack_pools. */
 static int pool_index;
 /* Offset to the unused space in the currently used pool. */
@@ -241,7 +243,7 @@ static void depot_keep_new_pool(void **p
 	 * as long as we do not exceed the maximum number of pools.
 	 */
 	if (pool_index + 1 < DEPOT_MAX_POOLS) {
-		stack_pools[pool_index + 1] = *prealloc;
+		new_pool = *prealloc;
 		*prealloc = NULL;
 	}
 
@@ -272,6 +274,8 @@ static bool depot_update_pools(size_t re
 		 * stack_depot_fetch().
 		 */
 		WRITE_ONCE(pool_index, pool_index + 1);
+		stack_pools[pool_index] = new_pool;
+		new_pool = NULL;
 		pool_offset = 0;
 
 		/*

_

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