Thread (9 messages) 9 messages, 3 authors, 2022-08-17

Re: [PATCH v2 1/2] mm/migrate_device.c: Copy pte dirty bit to page

From: Peter Xu <peterx@redhat.com>
Date: 2022-08-16 20:35:13
Also in: linux-mm, lkml, stable

On Tue, Aug 16, 2022 at 04:10:29PM +0800, huang ying wrote:
quoted
@@ -193,11 +194,10 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp,
                        bool anon_exclusive;
                        pte_t swp_pte;

+                       flush_cache_page(vma, addr, pte_pfn(*ptep));
+                       pte = ptep_clear_flush(vma, addr, ptep);
Although I think it's possible to batch the TLB flushing just before
unlocking PTL.  The current code looks correct.
If we're with unconditionally ptep_clear_flush(), does it mean we should
probably drop the "unmapped" and the last flush_tlb_range() already since
they'll be redundant?

If that'll need to be dropped, it looks indeed better to still keep the
batch to me but just move it earlier (before unlock iiuc then it'll be
safe), then we can keep using ptep_get_and_clear() afaiu but keep "pte"
updated.

Thanks,

-- 
Peter Xu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help