Mike, On Tue, May 11, 2021 at 07:25:39PM -0700, Mike Kravetz wrote: > I looked at this a bit more today and am not exactly sure of the > expected behavior. The situation is: > - UFFDIO_COPY is called for hugetlb mapping > - the dest address is in a shared mapping > - there is a page in the cache associated with the address in the > shared mapping > > Currently, the code will fail when trying to update the page cache as > the entry already exists. The shm code appears to do the same. > > Quick question. Is this the expected behavior? Or, would you expect > the UFFDIO_COPY to update the page in the page cache, and then resolve > the fault/update the pte? AFAICT that's the expected behavior, and it need to be like that so as to avoid silent data corruption (if the page cache existed, it means the page is not "missing" at all, then it does not suite for a UFFDIO_COPY as it's only used for uffd page missing case). Thanks, -- Peter Xu