[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <502BA96C.8070602@parallels.com>
Date: Wed, 15 Aug 2012 17:51:40 +0400
From: Glauber Costa <glommer@...allels.com>
To: Mel Gorman <mgorman@...e.de>
CC: <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
<cgroups@...r.kernel.org>, <devel@...nvz.org>,
Michal Hocko <mhocko@...e.cz>,
Johannes Weiner <hannes@...xchg.org>,
Andrew Morton <akpm@...ux-foundation.org>,
<kamezawa.hiroyu@...fujitsu.com>, Christoph Lameter <cl@...ux.com>,
David Rientjes <rientjes@...gle.com>,
Pekka Enberg <penberg@...nel.org>,
Pekka Enberg <penberg@...helsinki.fi>,
Suleiman Souhlal <suleiman@...gle.com>
Subject: Re: [PATCH v2 07/11] mm: Allocate kernel pages to the right memcg
On 08/15/2012 05:22 PM, Mel Gorman wrote:
>> I believe it
>> > to be a better and less complicated approach then letting a page appear
>> > and then charging it. Besides being consistent with the rest of memcg,
>> > it won't create unnecessary disturbance in the page allocator
>> > when the allocation is to fail.
>> >
> I still don't get why you did not just return a mem_cgroup instead of a
> handle.
>
Forgot this one, sorry:
The reason is to keep the semantics simple.
What should we return if the code is not compiled in? If we return NULL
for failure, the test becomes
memcg = memcg_kmem_charge_page(gfp, order);
if (!memcg)
exit;
If we're not compiled in, we'd either return positive garbage or we need
to wrap it inside an ifdef
I personally believe to be a lot more clear to standardize on true
to mean "allocation can proceed".
the compiled out case becomes:
if (!true)
exit;
which is easily compiled away altogether. Now of course, using struct
mem_cgroup makes sense, and I have already changed that here.
--
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