[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <002001d0815f$ce928750$6bb795f0$@alibaba-inc.com>
Date: Tue, 28 Apr 2015 11:02:46 +0800
From: "Hillf Danton" <hillf.zj@...baba-inc.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: "Sasha Levin" <sasha.levin@...cle.com>,
"linux-kernel" <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>
Subject: Re: [PATCHv5 04/28] mm, thp: adjust conditions when we can reuse the page on WP fault
>
> With new refcounting we will be able map the same compound page with
> PTEs and PMDs. It requires adjustment to conditions when we can reuse
> the page on write-protection fault.
>
> For PTE fault we can't reuse the page if it's part of huge page.
>
> For PMD we can only reuse the page if nobody else maps the huge page or
> it's part. We can do it by checking page_mapcount() on each sub-page,
> but it's expensive.
>
> The cheaper way is to check page_count() to be equal 1: every mapcount
> takes page reference, so this way we can guarantee, that the PMD is the
> only mapping.
>
> This approach can give false negative if somebody pinned the page, but
> that doesn't affect correctness.
>
Then we have to try more to allocate THP if pinned?
Are we adding new cost?
Hillf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists