All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Wanpeng Li <liwp.linux@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 01/10] mm: memcg: fix compaction/migration failing due to memcg limits
Date: Thu, 12 Jul 2012 11:42:03 +0200	[thread overview]
Message-ID: <20120712094202.GB1239@cmpxchg.org> (raw)
In-Reply-To: <20120712091043.GB3181@kernel>

On Thu, Jul 12, 2012 at 05:10:43PM +0800, Wanpeng Li wrote:
> On Thu, Jul 12, 2012 at 04:54:07PM +0800, Wanpeng Li wrote:
> >On Wed, Jul 11, 2012 at 07:02:13PM +0200, Johannes Weiner wrote:
> >>Compaction (and page migration in general) can currently be hindered
> >>through pages being owned by memory cgroups that are at their limits
> >>and unreclaimable.
> >>
> >>The reason is that the replacement page is being charged against the
> >>limit while the page being replaced is also still charged.  But this
> >>seems unnecessary, given that only one of the two pages will still be
> >>in use after migration finishes.
> >>
> >>This patch changes the memcg migration sequence so that the
> >>replacement page is not charged.  Whatever page is still in use after
> >>successful or failed migration gets to keep the charge of the page
> >>that was going to be replaced.
> >>
> >>The replacement page will still show up temporarily in the rss/cache
> >>statistics, this can be fixed in a later patch as it's less urgent.
> >>
> >
> >So I want to know after this patch be merged if mem_cgroup_wait_acct_move
> >still make sense, if the answer is no, I will send a patch to remove it.
> 
> And if this still make sense, I want to change check in
> mem_cgroup_do_charge:
> 
> if (mem_cgroup_wait_acct_move(mem_over_limit))
> 	return CHARGE_RETRY;
> 
> =>
> 
> if (mem_cgroup_wait_acct_move(mem_over_limit) && 
>                        mem_cgroup_margin(mem_over_limit) >= nr_pages)
> 	return CHARGE_RETRY;
> 
> Since mem_cgroup_relcaim can reclaim some pages, but in
> mem_cgroup_reclaim function there are some exit condition:
> 
> total += try_to_free_mem_cgroup_pages(memcg, gfp_mask, noswap);
> if(total && (flag & MEM_CGROUP_RECLAIM_SHRINK))
> 	break;
> 
> and 
> 
> if (mem_cgroup_margin(memcg))
> 	break;
> 
> So maybe mem_cgroup_reclaim not reclaim enough pages >= nr_pages, this
> time we should go to mem_cgroup_handle_oom instead of return
> CHARGE_RETRY.
> 
> Hopefully, you can verify if my idea make sense.

Sorry, but this is a waste of your time, my time, and that of
everybody else in this thread.

I will ignore any subsequent proposals from you unless they start with
a coherent description of an actual problem.  Something that has
impact on userspace, or significant impact on kernel development.

If there is a bug I don't see in your description above, than please
explain how it affects userspace.  If the code or comments are cryptic
and can be simplified or clarified, please explain.

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Wanpeng Li <liwp.linux@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 01/10] mm: memcg: fix compaction/migration failing due to memcg limits
Date: Thu, 12 Jul 2012 11:42:03 +0200	[thread overview]
Message-ID: <20120712094202.GB1239@cmpxchg.org> (raw)
In-Reply-To: <20120712091043.GB3181@kernel>

On Thu, Jul 12, 2012 at 05:10:43PM +0800, Wanpeng Li wrote:
> On Thu, Jul 12, 2012 at 04:54:07PM +0800, Wanpeng Li wrote:
> >On Wed, Jul 11, 2012 at 07:02:13PM +0200, Johannes Weiner wrote:
> >>Compaction (and page migration in general) can currently be hindered
> >>through pages being owned by memory cgroups that are at their limits
> >>and unreclaimable.
> >>
> >>The reason is that the replacement page is being charged against the
> >>limit while the page being replaced is also still charged.  But this
> >>seems unnecessary, given that only one of the two pages will still be
> >>in use after migration finishes.
> >>
> >>This patch changes the memcg migration sequence so that the
> >>replacement page is not charged.  Whatever page is still in use after
> >>successful or failed migration gets to keep the charge of the page
> >>that was going to be replaced.
> >>
> >>The replacement page will still show up temporarily in the rss/cache
> >>statistics, this can be fixed in a later patch as it's less urgent.
> >>
> >
> >So I want to know after this patch be merged if mem_cgroup_wait_acct_move
> >still make sense, if the answer is no, I will send a patch to remove it.
> 
> And if this still make sense, I want to change check in
> mem_cgroup_do_charge:
> 
> if (mem_cgroup_wait_acct_move(mem_over_limit))
> 	return CHARGE_RETRY;
> 
> =>
> 
> if (mem_cgroup_wait_acct_move(mem_over_limit) && 
>                        mem_cgroup_margin(mem_over_limit) >= nr_pages)
> 	return CHARGE_RETRY;
> 
> Since mem_cgroup_relcaim can reclaim some pages, but in
> mem_cgroup_reclaim function there are some exit condition:
> 
> total += try_to_free_mem_cgroup_pages(memcg, gfp_mask, noswap);
> if(total && (flag & MEM_CGROUP_RECLAIM_SHRINK))
> 	break;
> 
> and 
> 
> if (mem_cgroup_margin(memcg))
> 	break;
> 
> So maybe mem_cgroup_reclaim not reclaim enough pages >= nr_pages, this
> time we should go to mem_cgroup_handle_oom instead of return
> CHARGE_RETRY.
> 
> Hopefully, you can verify if my idea make sense.

Sorry, but this is a waste of your time, my time, and that of
everybody else in this thread.

I will ignore any subsequent proposals from you unless they start with
a coherent description of an actual problem.  Something that has
impact on userspace, or significant impact on kernel development.

If there is a bug I don't see in your description above, than please
explain how it affects userspace.  If the code or comments are cryptic
and can be simplified or clarified, please explain.

--
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:[~2012-07-12  9:42 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 17:02 [patch 00/10] mm: memcg: charge/uncharge improvements v2 Johannes Weiner
2012-07-11 17:02 ` Johannes Weiner
2012-07-11 17:02 ` Johannes Weiner
2012-07-11 17:02 ` [patch 01/10] mm: memcg: fix compaction/migration failing due to memcg limits Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-12  8:54   ` Wanpeng Li
2012-07-12  8:54     ` Wanpeng Li
2012-07-12  9:10     ` Wanpeng Li
2012-07-12  9:10       ` Wanpeng Li
2012-07-12  9:42       ` Johannes Weiner [this message]
2012-07-12  9:42         ` Johannes Weiner
2012-07-12  9:12     ` Johannes Weiner
2012-07-12  9:12       ` Johannes Weiner
2012-07-11 17:02 ` [patch 02/10] mm: swapfile: clean up unuse_pte race handling Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-11 17:02 ` [patch 03/10] mm: memcg: push down PageSwapCache check into uncharge entry functions Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-19  9:57   ` Kamezawa Hiroyuki
2012-07-19  9:57     ` Kamezawa Hiroyuki
2012-07-19  9:57     ` Kamezawa Hiroyuki
2012-07-11 17:02 ` [patch 04/10] mm: memcg: only check for PageSwapCache when uncharging anon Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-11 17:02 ` [patch 05/10] mm: memcg: move swapin charge functions above callsites Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-11 17:02 ` [patch 06/10] mm: memcg: remove unneeded shmem charge type Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-11 17:02 ` [patch 07/10] mm: memcg: remove needless !mm fixup to init_mm when charging Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-11 17:02 ` [patch 08/10] mm: memcg: split swapin charge function into private and public part Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-11 17:02 ` [patch 09/10] mm: memcg: only check swap cache pages for repeated charging Johannes Weiner
2012-07-11 17:02   ` Johannes Weiner
2012-07-11 17:02 ` [patch 10/10] mm: memcg: only check anon swapin page charges for swap cache Johannes Weiner
2012-07-11 17:02   ` 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=20120712094202.GB1239@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liwp.linux@gmail.com \
    --cc=mhocko@suse.cz \
    --cc=rientjes@google.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 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.