Skip to contentSkip to conversation

percpu-fix-data-race-with-pcpu_nr_empty_pop_pages.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Nov 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: percpu: fix data race with pcpu_nr_empty_pop_pages
has been removed from the -mm tree. Its filename was
percpu-fix-data-race-with-pcpu_nr_empty_pop_pages.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: Dennis Zhou <[email protected]>
Subject: percpu: fix data race with pcpu_nr_empty_pop_pages
Date: Mon, 7 Oct 2024 17:19:42 -0700

Fixes the data race by moving the read to be behind the pcpu_lock. This is okay because the code (initially) above it will not increase the empty populated page count because it is populating backing pages that already have allocations served out of them.

---

 mm/percpu.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
mm/percpu.c renamed from mm/percpu.c~percpu-fix-data-race-with-pcpu_nr_empty_pop_pages +4 -3
@@ -1864,6 +1864,10 @@ restart:
 
 area_found:
 	pcpu_stats_area_alloc(chunk, size);
+
+	if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_LOW)
+		pcpu_schedule_balance_work();
+
 	spin_unlock_irqrestore(&pcpu_lock, flags);
 
 	/* populate if not all pages are already there */
@@ -1891,9 +1895,6 @@ area_found:
 		mutex_unlock(&pcpu_alloc_mutex);
 	}
 
-	if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_LOW)
-		pcpu_schedule_balance_work();
-
 	/* clear the areas and return address relative to base address */
 	for_each_possible_cpu(cpu)
 		memset((void *)pcpu_chunk_addr(chunk, cpu, 0) + off, 0, size);

_

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