lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 28 May 2015 20:13:02 +0200
From:	Michal Hocko <mhocko@...e.cz>
To:	Vladimir Davydov <vdavydov@...allels.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, Johannes Weiner <hannes@...xchg.org>
Subject: Re: [PATCH] memcg: do not call reclaim if !__GFP_WAIT

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@...allels.com>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Michal Hocko <mhocko@...e.cz>

Acked-by: Michal Hocko <mhocko@...e.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ