# Re: \[PATCH v2 2/2\] mm: speed up mremap by 500x on large regions

- From: David Miller \<davem@davemloft.net\>
- Date: 2018-10-12 18:02:27 
- List: linux-alpha
- Page: https://ratatoskr.run/linux-alpha/2018/10/5406745
- Thread: https://ratatoskr.run/linux-alpha/2018/10/6489702/t.md

```text
From: "Kirill A. Shutemov" <redacted>
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.
```
