Messages in this thread | | | Date | Wed, 13 Apr 2022 20:28:38 +0200 | Subject | Re: [PATCH v3 12/16] mm: remember exclusively mapped anonymous pages with PG_anon_exclusive | From | Vlastimil Babka <> |
| |
On 4/13/22 18:39, David Hildenbrand wrote: >>> @@ -3035,10 +3083,19 @@ void set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw, >>> >>> flush_cache_range(vma, address, address + HPAGE_PMD_SIZE); >>> pmdval = pmdp_invalidate(vma, address, pvmw->pmd); >>> + >>> + anon_exclusive = PageAnon(page) && PageAnonExclusive(page); >>> + if (anon_exclusive && page_try_share_anon_rmap(page)) { >>> + set_pmd_at(mm, address, pvmw->pmd, pmdval); >>> + return; >> >> I am admittedly not too familiar with this code, but looks like this means >> we fail to migrate the THP, right? But we don't seem to be telling the >> caller, which is try_to_migrate_one(), so it will continue and not terminate >> the walk and return false? > > Right, we're not returning "false". Returning "false" would be an > optimization to make rmap_walk_anon() fail faster.
Ah right, that's what I missed, it's an optimization and we will realize elsewhere afterwards that the page has still mappings and we can't migrate...
> But, after all, the THP is exclusive (-> single mapping), so > anon_vma_interval_tree_foreach() would most probably not have a lot work > to do either way I'd assume? > > In any case, once we return from try_to_migrate(), the page will still > be mapped. >
| |