From: Johannes Weiner <hannes@cmpxchg.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Michal Hocko <mhocko@suse.cz>,
LKML <linux-kernel@vger.kernel.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Minchan Kim <minchan.kim@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Hansen <dave@linux.vnet.ibm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Randy Dunlap <rdunlap@xenotime.net>
Subject: Re: [PATCH v3] cgroup/kmemcheck: Annotate alloc_page() for cgroup allocations
Date: Wed, 27 Jul 2011 00:13:36 +0200 [thread overview]
Message-ID: <20110726221336.GC667@cmpxchg.org> (raw)
In-Reply-To: <1311707956.21143.2.camel@gandalf.stny.rr.com>
On Tue, Jul 26, 2011 at 03:19:16PM -0400, 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.
>
> I was triggering this output:
>
> allocated 8388608 bytes of page_cgroup
> please try 'cgroup_disable=memory' option if you don't want memory cgroups
> kmemleak: Trying to color unknown object at 0xf5840000 as Grey
> Pid: 0, comm: swapper Not tainted 3.0.0-test #12
> Call Trace:
> [<c17e34e6>] ? printk+0x1d/0x1f^M
> [<c10e2941>] paint_ptr+0x4f/0x78
> [<c178ab57>] kmemleak_not_leak+0x58/0x7d
> [<c108ae9f>] ? __rcu_read_unlock+0x9/0x7d
> [<c1cdb462>] kmemleak_init+0x19d/0x1e9
> [<c1cbf771>] start_kernel+0x346/0x3ec
> [<c1cbf1b4>] ? loglevel+0x18/0x18
> [<c1cbf0aa>] i386_start_kernel+0xaa/0xb0
>
> After a bit of debugging I tracked the object 0xf840000 (and others)
> down to the cgroup code. The change from allocating base with kmalloc to
> alloc_page() has the base not calling kmemleak_alloc() which adds the
> pointer to the object_tree_root, but kmemleak_not_leak() adds it to the
> crt_early_log[] table. On kmemleak_init(), the entry is found in the
> early_log[] but not the object_tree_root, and this error message is
> displayed.
>
> If alloc_page() fails then it defaults back to vmalloc() which still
> uses the kmemleak_alloc() which makes us still need the
> kmemleak_not_leak() call. The solution is to call the kmemleak_alloc()
> directly if the alloc_page() succeeds.
>
> Reviewed-by: Michal Hocko <mhocko@suse.cz>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
next prev parent reply other threads:[~2011-07-26 22:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-26 17:05 [PATCH] cgroup/kmemcheck: No need to annotate base anymore Steven Rostedt
2011-07-26 17:38 ` Michal Hocko
2011-07-26 17:41 ` Steven Rostedt
2011-07-26 17:44 ` Steven Rostedt
2011-07-26 18:17 ` [PATCH v2] cgroup/kmemcheck: Annotate alloc_page() for cgroup allocations Steven Rostedt
2011-07-26 18:43 ` Michal Hocko
2011-07-26 19:04 ` Steven Rostedt
2011-07-26 19:19 ` [PATCH v3] " Steven Rostedt
2011-07-26 22:13 ` Johannes Weiner [this message]
2011-07-26 23:03 ` Minchan Kim
2011-07-27 0:55 ` KAMEZAWA Hiroyuki
2011-08-12 9:58 ` Catalin Marinas
2011-07-27 2:10 ` [PATCH v3 RESEND] " Steven Rostedt
[not found] ` <1311732644.21143.5.camel-f9ZlEuEWxVcI6MkJdU+c8EEOCMrvLtNR@public.gmane.org>
2011-07-29 13:31 ` Steven Rostedt
2011-07-29 13:31 ` Steven Rostedt
[not found] ` <1311707088.21143.0.camel-f9ZlEuEWxVcI6MkJdU+c8EEOCMrvLtNR@public.gmane.org>
2011-07-27 2:10 ` Steven Rostedt
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=20110726221336.GC667@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=catalin.marinas@arm.com \
--cc=dave@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.cz \
--cc=minchan.kim@gmail.com \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=rdunlap@xenotime.net \
--cc=rostedt@goodmis.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.