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/20221021160603.GA23307@u164.east.ru 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 <peterx@redhat.com> Reported-by: Anatoly Pugachev <matorola@gmail.com> Tested-by: Anatoly Pugachev <matorola@gmail.com> Cc: Alistair Popple <apopple@nvidia.com> Cc: Andi Kleen <andi.kleen@intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: David Hildenbrand <david@redhat.com> Cc: David S. Miller <davem@davemloft.net> Cc: "Huang, Ying" <ying.huang@intel.com> Cc: Hugh Dickins <hughd@google.com> Cc: "Kirill A . Shutemov" <kirill@shutemov.name> Cc: Minchan Kim <minchan@kernel.org> Cc: Nadav Amit <nadav.amit@gmail.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 8ac932a commit 624a2c9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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)