Skip to contentSkip to conversation

mm-ksm-remove-redundant-code-in-ksm_fork.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 26, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/ksm: remove redundant code in ksm_fork
has been removed from the -mm tree. Its filename was
mm-ksm-remove-redundant-code-in-ksm_fork.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: Jinjiang Tu <[email protected]>
Subject: mm/ksm: remove redundant code in ksm_fork
Date: Tue, 2 Apr 2024 10:49:34 +0800

Since commit 3c6f33b7273a ("mm/ksm: support fork/exec for prctl"), when a child process is forked, the MMF_VM_MERGE_ANY flag will be inherited in mm_init(). So, it's unnecessary to set the flag in ksm_fork().

---

 include/linux/ksm.h |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
include/linux/ksm.h renamed from include/linux/ksm.h~mm-ksm-remove-redundant-code-in-ksm_fork +2 -10
@@ -45,16 +45,8 @@ static inline void ksm_might_unmap_zero_
 
 static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
 {
-	int ret;
-
-	if (test_bit(MMF_VM_MERGEABLE, &oldmm->flags)) {
-		ret = __ksm_enter(mm);
-		if (ret)
-			return ret;
-	}
-
-	if (test_bit(MMF_VM_MERGE_ANY, &oldmm->flags))
-		set_bit(MMF_VM_MERGE_ANY, &mm->flags);
+	if (test_bit(MMF_VM_MERGEABLE, &oldmm->flags))
+		return __ksm_enter(mm);
 
 	return 0;
 }

_

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