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]
Message-ID: <20160301160403.GL9461@dhcp22.suse.cz>
Date:	Tue, 1 Mar 2016 17:04:04 +0100
From:	Michal Hocko <mhocko@...nel.org>
To:	Vladimir Davydov <vdavydov@...tuozzo.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Tejun Heo <tj@...nel.org>,
	Johannes Weiner <hannes@...xchg.org>, cgroups@...r.kernel.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mm: memcontrol: cleanup css_reset callback

On Tue 01-03-16 14:13:12, Vladimir Davydov wrote:
>  - Do not take memcg_limit_mutex for resetting limits - the cgroup
>    cannot be altered from userspace anymore, so no need to protect them.
> 
>  - Use plain page_counter_limit() for resetting ->memory and ->memsw
>    limits instead of mem_cgrouop_resize_* helpers - we enlarge the
>    limits, so no need in special handling.
> 
>  - Reset ->swap and ->tcpmem limits as well.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@...tuozzo.com>

Acked-by: Michal Hocko <mhocko@...e.com>

> ---
>  mm/memcontrol.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index ae8b81c55685..8615b066b642 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4257,9 +4257,11 @@ static void mem_cgroup_css_reset(struct cgroup_subsys_state *css)
>  {
>  	struct mem_cgroup *memcg = mem_cgroup_from_css(css);
>  
> -	mem_cgroup_resize_limit(memcg, PAGE_COUNTER_MAX);
> -	mem_cgroup_resize_memsw_limit(memcg, PAGE_COUNTER_MAX);
> -	memcg_update_kmem_limit(memcg, PAGE_COUNTER_MAX);
> +	page_counter_limit(&memcg->memory, PAGE_COUNTER_MAX);
> +	page_counter_limit(&memcg->swap, PAGE_COUNTER_MAX);
> +	page_counter_limit(&memcg->memsw, PAGE_COUNTER_MAX);
> +	page_counter_limit(&memcg->kmem, PAGE_COUNTER_MAX);
> +	page_counter_limit(&memcg->tcpmem, PAGE_COUNTER_MAX);
>  	memcg->low = 0;
>  	memcg->high = PAGE_COUNTER_MAX;
>  	memcg->soft_limit = PAGE_COUNTER_MAX;
> -- 
> 2.1.4

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ