Skip to content

Commit 624a2c9

Browse files
xzpeterakpm00
authored andcommitted
Partly revert "mm/thp: carry over dirty bit when thp splits on pmd"
Anatoly Pugachev reported sparc64 breakage on the patch: https://lore.kernel.org/r/[email protected] The sparc64 impl of pte_mkdirty() is definitely slightly special in that it leverages a code patching mechanism for sun4u/sun4v on relevant pgtable entry operations. Before having a clue of why the sparc64 is special and caused the patch to SIGSEGV the processes, revert the patch for now. The swap path of dirty bit inheritage is kept because that's using the swap shared code so we assume it'll not be affected. Link: https://lkml.kernel.org/r/Y1Wbi4yyVvDtg4zN@x1n Fixes: 0ccf7f1 ("mm/thp: carry over dirty bit when thp splits on pmd") Signed-off-by: Peter Xu <[email protected]> Reported-by: Anatoly Pugachev <[email protected]> Tested-by: Anatoly Pugachev <[email protected]> Cc: Alistair Popple <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: David S. Miller <[email protected]> Cc: "Huang, Ying" <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: "Kirill A . Shutemov" <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Nadav Amit <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 8ac932a commit 624a2c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mm/huge_memory.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,9 +2206,12 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
22062206
entry = pte_wrprotect(entry);
22072207
if (!young)
22082208
entry = pte_mkold(entry);
2209-
/* NOTE: this may set soft-dirty too on some archs */
2210-
if (dirty)
2211-
entry = pte_mkdirty(entry);
2209+
/*
2210+
* NOTE: we don't do pte_mkdirty when dirty==true
2211+
* because it breaks sparc64 which can sigsegv
2212+
* random process. Need to revisit when we figure
2213+
* out what is special with sparc64.
2214+
*/
22122215
if (soft_dirty)
22132216
entry = pte_mksoft_dirty(entry);
22142217
if (uffd_wp)

0 commit comments

Comments
 (0)