[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110812095827.GB1639@e102109-lin.cambridge.arm.com>
Date: Fri, 12 Aug 2011 10:58:28 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Michal Hocko <mhocko@...e.cz>, LKML <linux-kernel@...r.kernel.org>,
Johannes Weiner <hannes@...xchg.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
Balbir Singh <balbir@...ux.vnet.ibm.com>,
Minchan Kim <minchan.kim@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
Randy Dunlap <rdunlap@...otime.net>
Subject: Re: [PATCH v3] cgroup/kmemcheck: Annotate alloc_page() for cgroup
allocations
On Tue, Jul 26, 2011 at 08:19:16PM +0100, Steven Rostedt wrote:
> When the cgroup base was allocated with kmalloc, it was necessary to
> annotate the variable with kmemcheck_not_leak(). But because it has
> recently been changed to be allocated with alloc_page() (which skips
> kmemleak checks) causes a warning on boot up.
Sorry for the delay, too much holiday over here :)
> diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
> index 53bffc6..1eb534a 100644
> --- a/mm/page_cgroup.c
> +++ b/mm/page_cgroup.c
> @@ -133,10 +133,13 @@ struct page *lookup_cgroup_page(struct page_cgroup *pc)
> static void *__meminit alloc_page_cgroup(size_t size, int nid)
> {
> void *addr = NULL;
> + gfp_t flags = GFP_KERNEL | __GFP_NOWARN;
>
> - addr = alloc_pages_exact_nid(nid, size, GFP_KERNEL | __GFP_NOWARN);
> - if (addr)
> + addr = alloc_pages_exact_nid(nid, size, flags);
> + if (addr) {
> + kmemleak_alloc(addr, size, 1, flags);
> return addr;
> + }
>
> if (node_state(nid, N_HIGH_MEMORY))
> addr = vmalloc_node(size, nid);
The __GFP_NOWARN is already added by kmemleak_alloc but there is no harm
in leaving it.
One minor thing with the subject, unless you already submitted the
patch - it's kmemleak rather than kmemcheck (different things,
confusingly).
Acked-by: Catalin Marinas <catalin.marinas@....com>
--
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