linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] mm: memcontrol: clean up reclaim size variable use in try_charge()
Date: Tue, 5 Aug 2014 14:26:36 +0200	[thread overview]
Message-ID: <20140805122636.GE15908@dhcp22.suse.cz> (raw)
In-Reply-To: <1407184502-20818-1-git-send-email-hannes@cmpxchg.org>

On Mon 04-08-14 16:35:02, Johannes Weiner wrote:
> Charge reclaim and OOM currently use the charge batch variable, but
> batching is already disabled at that point.  To simplify the charge
> logic, the batch variable is reset to the original request size when
> reclaim is entered, so it's functionally equal, but it's misleading.
> 
> Switch reclaim/OOM to nr_pages, which is the original request size.
> 
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
>  mm/memcontrol.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 8d65dadeec1b..ec4dcf1b9562 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2574,7 +2574,7 @@ retry:
>  
>  	nr_reclaimed = mem_cgroup_reclaim(mem_over_limit, gfp_mask, flags);
>  
> -	if (mem_cgroup_margin(mem_over_limit) >= batch)
> +	if (mem_cgroup_margin(mem_over_limit) >= nr_pages)
>  		goto retry;
>  
>  	if (gfp_mask & __GFP_NORETRY)
> @@ -2588,7 +2588,7 @@ retry:
>  	 * unlikely to succeed so close to the limit, and we fall back
>  	 * to regular pages anyway in case of failure.
>  	 */
> -	if (nr_reclaimed && batch <= (1 << PAGE_ALLOC_COSTLY_ORDER))
> +	if (nr_reclaimed && nr_pages <= (1 << PAGE_ALLOC_COSTLY_ORDER))
>  		goto retry;
>  	/*
>  	 * At task move, charge accounts can be doubly counted. So, it's
> @@ -2606,7 +2606,7 @@ retry:
>  	if (fatal_signal_pending(current))
>  		goto bypass;
>  
> -	mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(batch));
> +	mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(nr_pages));
>  nomem:
>  	if (!(gfp_mask & __GFP_NOFAIL))
>  		return -ENOMEM;
> -- 
> 2.0.3
> 

-- 
Michal Hocko
SUSE Labs

--
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:[~2014-08-05 12:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 20:35 Johannes Weiner
2014-08-05 12:26 ` Michal Hocko [this message]

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=20140805122636.GE15908@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox