[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191025153618.ajcecye3bjm5abax@box>
Date: Fri, 25 Oct 2019 18:36:18 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Yang Shi <yang.shi@...ux.alibaba.com>
Cc: hughd@...gle.com, kirill.shutemov@...ux.intel.com,
aarcange@...hat.com, akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: thp: clear PageDoubleMap flag when the last PMD map
gone
On Fri, Oct 25, 2019 at 01:27:46AM +0800, Yang Shi wrote:
> File THP sets PageDoubleMap flag when the first it gets PTE mapped, but
> the flag is never cleared until the THP is freed. This result in
> unbalanced state although it is not a big deal.
>
> Clear the flag when the last compound_mapcount is gone. It should be
> cleared when all the PTE maps are gone (become PMD mapped only) as well,
> but this needs check all subpage's _mapcount every time any subpage's
> rmap is removed, the overhead may be not worth. The anonymous THP also
> just clears PageDoubleMap flag when the last PMD map is gone.
NAK, sorry.
The key difference with anon THP that file THP can be mapped again with
PMD after all PMD (or all) mappings are gone.
Your patch breaks the case when you map the page with PMD again while the
page is still mapped with PTEs. Who would set PageDoubleMap() in this
case?
--
Kirill A. Shutemov
Powered by blists - more mailing lists