linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Vladimir Davydov <vdavydov@parallels.com>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH mmotm] memcg: Ignore partial THP when moving task
Date: Tue, 8 Dec 2015 12:35:28 -0500	[thread overview]
Message-ID: <20151208173528.GA32265@cmpxchg.org> (raw)
In-Reply-To: <1449594789-15866-1-git-send-email-mhocko@kernel.org>

On Tue, Dec 08, 2015 at 06:13:09PM +0100, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> After "mm: rework mapcount accounting to enable 4k mapping of THPs"
> it is possible to have a partial THP accessible via ptes. Memcg task
> migration code is not prepared for this situation and uncharges the tail
> page from the original memcg while the original THP is still charged via
> the head page which is not mapped to the moved task. The page counter
> of the origin memcg will underflow when the whole THP is uncharged later
> on and lead to:
> WARNING: CPU: 0 PID: 1340 at mm/page_counter.c:26 page_counter_cancel+0x34/0x40()
> reported by Minchan Kim.
> 
> This patch prevents from the underflow by skipping any partial THP pages
> in mem_cgroup_move_charge_pte_range. PageTransCompound is checked when
> we do pte walk. This means that a process might leave a partial THP
> behind in the original memcg if there is no other process mapping it via
> pmd but this is considered acceptable because it shouldn't happen often
> and this is not considered a memory leak because the original THP is
> still accessible and reclaimable. Moreover the task migration has always
> been racy and never guaranteed to move all pages.
> 
> Reported-by: Minchan Kim <minchan@kernel.org>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---
> 
> Hi,
> this is a patch tested by Minchan in the original thread [1]. I have
> only replaced PageCompound with PageTransCompound because other similar
> fixes in mmotm used this one. The underlying implementation is the same.
> Johannes, I have kept your a-b but let me know if you are not OK with the
> changelog.

Looks good to me, thanks Michal. Please keep my Acked-by.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-12-08 17:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 17:13 Michal Hocko
2015-12-08 17:35 ` Johannes Weiner [this message]
2015-12-09  9:07 ` Michal Hocko

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=20151208173528.GA32265@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=vdavydov@parallels.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