[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120313143316.0ef74d0e.akpm@linux-foundation.org>
Date: Tue, 13 Mar 2012 14:33:16 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc: linux-mm@...ck.org, mgorman@...e.de,
kamezawa.hiroyu@...fujitsu.com, dhillf@...il.com,
aarcange@...hat.com, mhocko@...e.cz, hannes@...xchg.org,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org
Subject: Re: [PATCH -V3 2/8] memcg: Add HugeTLB extension
On Tue, 13 Mar 2012 12:37:06 +0530
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com> wrote:
> +static int mem_cgroup_hugetlb_usage(struct mem_cgroup *memcg)
> +{
> + int idx;
> + for (idx = 0; idx < hugetlb_max_hstate; idx++) {
> + if (memcg->hugepage[idx].usage > 0)
> + return memcg->hugepage[idx].usage;
> + }
> + return 0;
> +}
Please document the function? Had you done this, I might have been
able to work out why the function bales out on the first used hugepage
size, but I can't :(
This could have used for_each_hstate(), had that macro been better
designed (or updated).
Upon return this function coerces an unsigned long long into an "int".
We decided last week that more than 2^32 hugepages was not
inconceivable, so I guess that's a bug.
--
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