All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Michal Hocko <mhocko@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: memcg uncharge page counter mismatch
Date: Fri, 4 Dec 2015 11:01:28 -0500	[thread overview]
Message-ID: <20151204160128.GA24431@cmpxchg.org> (raw)
In-Reply-To: <20151203154729.GI9264@dhcp22.suse.cz>

On Thu, Dec 03, 2015 at 04:47:29PM +0100, Michal Hocko wrote:
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 79a29d564bff..143c933f0b81 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4895,6 +4895,14 @@ static int mem_cgroup_move_charge_pte_range(pmd_t *pmd,
>  		switch (get_mctgt_type(vma, addr, ptent, &target)) {
>  		case MC_TARGET_PAGE:
>  			page = target.page;
> +			/*
> +			 * We can have a part of the split pmd here. Moving it
> +			 * can be done but it would be too convoluted so simply
> +			 * ignore such a partial THP and keep it in original
> +			 * memcg. There should be somebody mapping the head.
> +			 */
> +			if (PageCompound(page))
> +				goto put;
>  			if (isolate_lru_page(page))
>  				goto put;
>  			if (!mem_cgroup_move_account(page, false,

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

The charge moving concept is fundamentally flawed and its
implementation here is incomplete and races with reclaim.

Really, nobody should be using this. Absent any actual regression
reports, a minimal fix to stop this code from generating warnings
should be enough.

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Michal Hocko <mhocko@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: memcg uncharge page counter mismatch
Date: Fri, 4 Dec 2015 11:01:28 -0500	[thread overview]
Message-ID: <20151204160128.GA24431@cmpxchg.org> (raw)
In-Reply-To: <20151203154729.GI9264@dhcp22.suse.cz>

On Thu, Dec 03, 2015 at 04:47:29PM +0100, Michal Hocko wrote:
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 79a29d564bff..143c933f0b81 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4895,6 +4895,14 @@ static int mem_cgroup_move_charge_pte_range(pmd_t *pmd,
>  		switch (get_mctgt_type(vma, addr, ptent, &target)) {
>  		case MC_TARGET_PAGE:
>  			page = target.page;
> +			/*
> +			 * We can have a part of the split pmd here. Moving it
> +			 * can be done but it would be too convoluted so simply
> +			 * ignore such a partial THP and keep it in original
> +			 * memcg. There should be somebody mapping the head.
> +			 */
> +			if (PageCompound(page))
> +				goto put;
>  			if (isolate_lru_page(page))
>  				goto put;
>  			if (!mem_cgroup_move_account(page, false,

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

The charge moving concept is fundamentally flawed and its
implementation here is incomplete and races with reclaim.

Really, nobody should be using this. Absent any actual regression
reports, a minimal fix to stop this code from generating warnings
should be enough.

--
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>

  parent reply	other threads:[~2015-12-04 16:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 13:34 memcg uncharge page counter mismatch Minchan Kim
2015-12-01 13:34 ` Minchan Kim
2015-12-02 10:16 ` Michal Hocko
2015-12-02 10:16   ` Michal Hocko
2015-12-03  1:34   ` Minchan Kim
2015-12-03  1:34     ` Minchan Kim
2015-12-03  2:10     ` Minchan Kim
2015-12-03  2:10       ` Minchan Kim
2015-12-03  8:54       ` Michal Hocko
2015-12-03  8:54         ` Michal Hocko
2015-12-03 12:59         ` Minchan Kim
2015-12-03 12:59           ` Minchan Kim
2015-12-03 13:37           ` Michal Hocko
2015-12-03 13:37             ` Michal Hocko
2015-12-03 13:43             ` Michal Hocko
2015-12-03 13:43               ` Michal Hocko
2015-12-03 14:58               ` Michal Hocko
2015-12-03 14:58                 ` Michal Hocko
2015-12-03 15:47                 ` Michal Hocko
2015-12-03 15:47                   ` Michal Hocko
2015-12-04  5:35                   ` Minchan Kim
2015-12-04  5:35                     ` Minchan Kim
2015-12-04  8:52                     ` Michal Hocko
2015-12-04  8:52                       ` Michal Hocko
2015-12-04  9:16                       ` Minchan Kim
2015-12-04  9:16                         ` Minchan Kim
2015-12-04  9:58                         ` Michal Hocko
2015-12-04  9:58                           ` Michal Hocko
2015-12-04 13:35                           ` Minchan Kim
2015-12-04 13:35                             ` Minchan Kim
2015-12-04 16:01                   ` Johannes Weiner [this message]
2015-12-04 16:01                     ` Johannes Weiner

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=20151204160128.GA24431@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=minchan@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.