From: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> Date: Fri, 12 Oct 2018 14:30:56 +0300
I looked into the code more and noticed move_pte() helper called from move_ptes(). It changes PTE entry to suite new address. It is only defined in non-trivial way on Sparc. I don't know much about Sparc and it's hard for me to say if the optimization will break anything there. I think it worth to disable the optimization if __HAVE_ARCH_MOVE_PTE is defined. Or make architectures state explicitely that the optimization is safe.
What sparc is doing in move_pte() is flushing the data-cache (synchronously) if the virtual address color of the mapping changes. Hope this helps.