Skip to contentSkip to conversation

mm-page_counters-initialize-usage-using-atomic_long_init-macro.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 2, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: page_counters: initialize usage using ATOMIC_LONG_INIT() macro
has been removed from the -mm tree. Its filename was
mm-page_counters-initialize-usage-using-atomic_long_init-macro.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: Roman Gushchin <[email protected]>
Subject: mm: page_counters: initialize usage using ATOMIC_LONG_INIT() macro
Date: Fri, 26 Jul 2024 20:31:10 +0000

When a page_counter structure is initialized, there is no need to use an atomic set operation to initialize the usage counter because at this point the structure is not visible to anybody else. ATOMIC_LONG_INIT() is what should be used in such cases.

---

 include/linux/page_counter.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/page_counter.h renamed from include/linux/page_counter.h~mm-page_counters-initialize-usage-using-atomic_long_init-macro +1 -1
@@ -52,7 +52,7 @@ static inline void page_counter_init(str
 				     struct page_counter *parent,
 				     bool protection_support)
 {
-	atomic_long_set(&counter->usage, 0);
+	counter->usage = (atomic_long_t)ATOMIC_LONG_INIT(0);
 	counter->max = PAGE_COUNTER_MAX;
 	counter->parent = parent;
 	counter->protection_support = protection_support;

_

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