From: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
To: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>,
Kamezawa Hiroyuki
<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Hugh Dickins <hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Ying Han <yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Mel Gorman <mgorman-l3A5Bk7waGM@public.gmane.org>,
Rik van Riel <riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] memcg: reduce the size of struct memcg 244-fold.
Date: Thu, 24 Jan 2013 10:28:21 +0400 [thread overview]
Message-ID: <5100D485.4020302@parallels.com> (raw)
In-Reply-To: <20130123161810.73e4ca58.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
>> struct mem_cgroup *memcg;
>> - int size = sizeof(struct mem_cgroup);
>> + int size = memcg_size();
>>
>> - /* Can be very big if MAX_NUMNODES is very big */
>> + /* Can be very big if nr_node_ids is very big */
>> if (size < PAGE_SIZE)
>> memcg = kzalloc(size, GFP_KERNEL);
>> else
>> @@ -5933,7 +5943,7 @@ out_free:
>> static void __mem_cgroup_free(struct mem_cgroup *memcg)
>> {
>> int node;
>> - int size = sizeof(struct mem_cgroup);
>> + int size = memcg_size();
>>
>> mem_cgroup_remove_from_trees(memcg);
>> free_css_id(&mem_cgroup_subsys, &memcg->css);
>
> Really everything here should be using size_t - a minor
> cosmetic/readability thing.
>
I agree
WARNING: multiple messages have this Message-ID (diff)
From: Glauber Costa <glommer@parallels.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, cgroups@vger.kernel.org,
Michal Hocko <mhocko@suse.cz>,
Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Greg Thelen <gthelen@google.com>, Hugh Dickins <hughd@google.com>,
Ying Han <yinghan@google.com>, Mel Gorman <mgorman@suse.de>,
Rik van Riel <riel@redhat.com>
Subject: Re: [PATCH] memcg: reduce the size of struct memcg 244-fold.
Date: Thu, 24 Jan 2013 10:28:21 +0400 [thread overview]
Message-ID: <5100D485.4020302@parallels.com> (raw)
In-Reply-To: <20130123161810.73e4ca58.akpm@linux-foundation.org>
>> struct mem_cgroup *memcg;
>> - int size = sizeof(struct mem_cgroup);
>> + int size = memcg_size();
>>
>> - /* Can be very big if MAX_NUMNODES is very big */
>> + /* Can be very big if nr_node_ids is very big */
>> if (size < PAGE_SIZE)
>> memcg = kzalloc(size, GFP_KERNEL);
>> else
>> @@ -5933,7 +5943,7 @@ out_free:
>> static void __mem_cgroup_free(struct mem_cgroup *memcg)
>> {
>> int node;
>> - int size = sizeof(struct mem_cgroup);
>> + int size = memcg_size();
>>
>> mem_cgroup_remove_from_trees(memcg);
>> free_css_id(&mem_cgroup_subsys, &memcg->css);
>
> Really everything here should be using size_t - a minor
> cosmetic/readability thing.
>
I agree
--
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>
next prev parent reply other threads:[~2013-01-24 6:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-23 17:33 [PATCH] memcg: reduce the size of struct memcg 244-fold Glauber Costa
2013-01-23 17:33 ` Glauber Costa
[not found] ` <1358962426-8738-1-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2013-01-24 0:18 ` Andrew Morton
2013-01-24 0:18 ` Andrew Morton
[not found] ` <20130123161810.73e4ca58.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2013-01-24 6:28 ` Glauber Costa [this message]
2013-01-24 6:28 ` Glauber Costa
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=5100D485.4020302@parallels.com \
--to=glommer-bzqdu9zft3wakbo8gow8eq@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mgorman-l3A5Bk7waGM@public.gmane.org \
--cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
--cc=riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.