[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5fc7d007-e59b-de8d-4d88-3f1b5adfa95b@suse.cz>
Date: Wed, 13 Apr 2022 20:28:38 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Hugh Dickins <hughd@...gle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
David Rientjes <rientjes@...gle.com>,
Shakeel Butt <shakeelb@...gle.com>,
John Hubbard <jhubbard@...dia.com>,
Jason Gunthorpe <jgg@...dia.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Yang Shi <shy828301@...il.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Matthew Wilcox <willy@...radead.org>,
Jann Horn <jannh@...gle.com>, Michal Hocko <mhocko@...nel.org>,
Nadav Amit <namit@...are.com>, Rik van Riel <riel@...riel.com>,
Roman Gushchin <guro@...com>,
Andrea Arcangeli <aarcange@...hat.com>,
Peter Xu <peterx@...hat.com>,
Donald Dutile <ddutile@...hat.com>,
Christoph Hellwig <hch@....de>,
Oleg Nesterov <oleg@...hat.com>, Jan Kara <jack@...e.cz>,
Liang Zhang <zhangliang5@...wei.com>,
Pedro Gomes <pedrodemargomes@...il.com>,
Oded Gabbay <oded.gabbay@...il.com>, linux-mm@...ck.org
Subject: Re: [PATCH v3 12/16] mm: remember exclusively mapped anonymous pages
with PG_anon_exclusive
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.
>
Powered by blists - more mailing lists