Skip to contentSkip to conversation

mm-userfaultfd-use-swap-in-double_pt_lock.patch removed from -mm tree

merged mm-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: mm: userfaultfd: use swap() in double_pt_lock()
has been removed from the -mm tree. Its filename was
mm-userfaultfd-use-swap-in-double_pt_lock.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: Jiapeng Chong <[email protected]>
Subject: mm: userfaultfd: use swap() in double_pt_lock()
Date: Fri, 31 May 2024 17:16:43 +0800

Use existing swap() function rather than duplicating its implementation.

./mm/userfaultfd.c:1006:13-14: WARNING opportunity for swap()

---

 mm/userfaultfd.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
mm/userfaultfd.c renamed from mm/userfaultfd.c~mm-userfaultfd-use-swap-in-double_pt_lock +2 -8
@@ -995,14 +995,8 @@ void double_pt_lock(spinlock_t *ptl1,
 	__acquires(ptl1)
 	__acquires(ptl2)
 {
-	spinlock_t *ptl_tmp;
-
-	if (ptl1 > ptl2) {
-		/* exchange ptl1 and ptl2 */
-		ptl_tmp = ptl1;
-		ptl1 = ptl2;
-		ptl2 = ptl_tmp;
-	}
+	if (ptl1 > ptl2)
+		swap(ptl1, ptl2);
 	/* lock in virtual address order to avoid lock inversion */
 	spin_lock(ptl1);
 	if (ptl1 != ptl2)

_

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