Skip to contentSkip to conversation

mm/autonuma: Don't mark pte saved write in case of dirty_accountable.

PATCH New Aneesh Kumar K.V 1 participant 1 message Feb 24, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/autonuma: Don't mark pte saved write in case of dirty_accountable.

We never request for protection update with ditry_accountable set and prot_numa set. Hence mark the pte with mkwrite instead mk_savedwrite.

Found this when running stress-ng test with debug check enabled. This trigger the VM_BUG_ON in pte_mk_savedwrite()

---
 mm/mprotect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mprotect.c +1 -1
index 15f5c174a7c1..bccccc73080d 100644
@@ -119,7 +119,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
 			if (dirty_accountable && pte_dirty(ptent) &&
 					(pte_soft_dirty(ptent) ||
 					 !(vma->vm_flags & VM_SOFTDIRTY))) {
-				ptent = pte_mk_savedwrite(ptent);
+				ptent = pte_mkwrite(ptent);
 			}
 			ptep_modify_prot_commit(mm, addr, pte, ptent);
 			pages++;
Signature · 7 lines
2.7.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>