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: <20131216164730.GD26797@dhcp22.suse.cz>
Date:	Mon, 16 Dec 2013 17:47:30 +0100
From:	Michal Hocko <mhocko@...e.cz>
To:	Vladimir Davydov <vdavydov@...allels.com>
Cc:	glommer@...il.com, linux-kernel@...r.kernel.org,
	cgroups@...r.kernel.org, linux-mm@...ck.org, devel@...nvz.org,
	Glauber Costa <glommer@...nvz.org>,
	Johannes Weiner <hannes@...xchg.org>,
	Balbir Singh <bsingharora@...il.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [PATCH 1/2] memcg: fix memcg_size() calculation

On Sat 14-12-13 12:15:33, Vladimir Davydov wrote:
> The mem_cgroup structure contains nr_node_ids pointers to
> mem_cgroup_per_node objects, not the objects themselves.

Ouch! This is 2k per node which is wasted. What a shame I haven't
noticed this back then when reviewing 45cf7ebd5a033 (memcg: reduce the
size of struct memcg 244-fold)

> Signed-off-by: Vladimir Davydov <vdavydov@...allels.com>
> Cc: Michal Hocko <mhocko@...e.cz>
> Cc: Glauber Costa <glommer@...nvz.org>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Balbir Singh <bsingharora@...il.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>

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

Thanks!

> ---
>  mm/memcontrol.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index bf5e894..7f1a356 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -338,7 +338,7 @@ struct mem_cgroup {
>  static size_t memcg_size(void)
>  {
>  	return sizeof(struct mem_cgroup) +
> -		nr_node_ids * sizeof(struct mem_cgroup_per_node);
> +		nr_node_ids * sizeof(struct mem_cgroup_per_node *);
>  }
>  
>  /* internal only representation about the status of kmem accounting. */
> -- 
> 1.7.10.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