linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Vladimir Davydov <vdavydov@parallels.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] memcg: do not call reclaim if !__GFP_WAIT
Date: Thu, 28 May 2015 20:13:02 +0200	[thread overview]
Message-ID: <20150528181301.GC2321@dhcp22.suse.cz> (raw)
In-Reply-To: <1432833966-25538-1-git-send-email-vdavydov@parallels.com>

On Thu 28-05-15 20:26:06, Vladimir Davydov wrote:
> When trimming memcg consumption excess (see memory.high), we call
> try_to_free_mem_cgroup_pages without checking if we are allowed to sleep
> in the current context, which can result in a deadlock. Fix this.
> 

Fixes: 241994ed8649 ("mm: memcontrol: default hierarchy interface for memory")

And I would make it for stable 4.0

> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Michal Hocko <mhocko@suse.cz>

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

Thanks!

> ---
>  mm/memcontrol.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 14c2f2017e37..9da23a7ec4c0 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2323,6 +2323,8 @@ done_restock:
>  	css_get_many(&memcg->css, batch);
>  	if (batch > nr_pages)
>  		refill_stock(memcg, batch - nr_pages);
> +	if (!(gfp_mask & __GFP_WAIT))
> +		goto done;
>  	/*
>  	 * If the hierarchy is above the normal consumption range,
>  	 * make the charging task trim their excess contribution.
> -- 
> 2.1.4
> 

-- 
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:[~2015-05-28 18:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 17:26 [PATCH] memcg: do not call reclaim if !__GFP_WAIT Vladimir Davydov
2015-05-28 18:13 ` Michal Hocko [this message]
2015-05-28 19:59 ` Andrew Morton
2015-05-29  6:55   ` Michal Hocko
2015-06-01 16:42     ` Vlastimil Babka

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=20150528181301.GC2321@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).