Skip to contentSkip to conversation

lib-min_heap-update-min_heap_push-to-use-min_heap_sift_up.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Jun 25, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: lib min_heap: update min_heap_push() to use min_heap_sift_up()
has been removed from the -mm tree. Its filename was
lib-min_heap-update-min_heap_push-to-use-min_heap_sift_up.patch

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

------------------------------------------------------
From: Kuan-Wei Chiu <[email protected]>
Subject: lib min_heap: update min_heap_push() to use min_heap_sift_up()
Date: Fri, 24 May 2024 23:29:55 +0800

Update min_heap_push() to use min_heap_sift_up() rather than its origin inline version.

Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Bagas Sanjaya <[email protected]>
Cc Brian Foster <[email protected]>
Cc Ching-Chun (Jim) Huang <[email protected]>
Cc Coly Li <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kent Overstreet <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Matthew Sakai <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Randy Dunlap <[email protected]>

---

 include/linux/min_heap.h |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
include/linux/min_heap.h renamed from include/linux/min_heap.h~lib-min_heap-update-min_heap_push-to-use-min_heap_sift_up +1 -8
@@ -190,7 +190,6 @@ bool __min_heap_push(min_heap_char *heap
 		const struct min_heap_callbacks *func, void *args)
 {
 	void *data = heap->data;
-	void *child, *parent;
 	int pos;
 
 	if (WARN_ONCE(heap->nr >= heap->size, "Pushing on a full heap"))
@@ -202,13 +201,7 @@ bool __min_heap_push(min_heap_char *heap
 	heap->nr++;
 
 	/* Sift child at pos up. */
-	for (; pos > 0; pos = (pos - 1) / 2) {
-		child = data + (pos * elem_size);
-		parent = data + ((pos - 1) / 2) * elem_size;
-		if (func->less(parent, child, args))
-			break;
-		func->swp(parent, child, args);
-	}
+	__min_heap_sift_up(heap, elem_size, pos, func, args);
 
 	return true;
 }

_

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