linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Yang Shi <yang.shi@linux.alibaba.com>
Cc: hughd@google.com, kirill.shutemov@linux.intel.com,
	aarcange@redhat.com, akpm@linux-foundation.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: thp: clear PageDoubleMap flag when the last PMD map gone
Date: Fri, 25 Oct 2019 18:36:18 +0300	[thread overview]
Message-ID: <20191025153618.ajcecye3bjm5abax@box> (raw)
In-Reply-To: <1571938066-29031-1-git-send-email-yang.shi@linux.alibaba.com>

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

  parent reply	other threads:[~2019-10-25 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 17:27 [PATCH] mm: thp: clear PageDoubleMap flag when the last PMD map gone Yang Shi
2019-10-24 19:26 ` Song Liu
2019-10-25 15:36 ` Kirill A. Shutemov [this message]
2019-10-25 15:58   ` Yang Shi
2019-10-25 16:32     ` Kirill A. Shutemov
2019-10-25 16:39       ` Kirill A. Shutemov
2019-10-25 18:49         ` Yang Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191025153618.ajcecye3bjm5abax@box \
    --to=kirill@shutemov.name \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yang.shi@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).