public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mel@csn.ul.ie>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	torvalds@linux-foundation.org, fengguang.wu@intel.com,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	linux-kernel@vger.kernel.org
Subject: Re: WARNING: at mm/page_alloc.c:1159 get_page_from_freelist+0x325/0x655()
Date: Wed, 17 Jun 2009 13:40:34 +0100	[thread overview]
Message-ID: <20090617124034.GE28529@csn.ul.ie> (raw)
In-Reply-To: <1245242160.11889.23.camel@pc1117.cambridge.arm.com>

On Wed, Jun 17, 2009 at 01:36:00PM +0100, Catalin Marinas wrote:
> On Wed, 2009-06-17 at 13:28 +0100, Mel Gorman wrote:
> > On Wed, Jun 17, 2009 at 01:11:17PM +0100, Catalin Marinas wrote:
> > > On Wed, 2009-06-17 at 13:31 +0200, Ingo Molnar wrote:
> > > > a new warning started popping up today, in the new page allocator 
> > > > code. The allocation came from kmemleak:
> > > > 
> > > > WARNING: at mm/page_alloc.c:1159 get_page_from_freelist+0x325/0x655()
> > > > Hardware name: System Product Name
> > > > Modules linked in:
> > > > Pid: 4367, comm: ifup Not tainted 2.6.30-tip-04303-g5ada65e-dirty #54431
> > > > Call Trace:
> > > >  [<ffffffff810dba73>] ? get_page_from_freelist+0x325/0x655
> > > >  [<ffffffff8106f140>] warn_slowpath_common+0x88/0xcb
> > > >  [<ffffffff8106f1a5>] warn_slowpath_null+0x22/0x38
> > > >  [<ffffffff810dba73>] get_page_from_freelist+0x325/0x655
> > > >  [<ffffffff810dc18c>] __alloc_pages_nodemask+0x14c/0x5b0
> > > >  [<ffffffff811063e1>] ? deactivate_slab+0xce/0x16b
> > > >  [<ffffffff8103b1c8>] ? native_sched_clock+0x40/0x79
> > > >  [<ffffffff811063e1>] ? deactivate_slab+0xce/0x16b
> > > >  [<ffffffff811063e1>] ? deactivate_slab+0xce/0x16b
> > > >  [<ffffffff81102417>] alloc_pages_current+0xcc/0xeb
> > > >  [<ffffffff81107a78>] alloc_slab_page+0x2a/0x7e
> > > >  [<ffffffff81107b27>] new_slab+0x5b/0x210
> > > >  [<ffffffff811063fa>] ? deactivate_slab+0xe7/0x16b
> > > >  [<ffffffff81108253>] __slab_alloc+0x214/0x3da
> > > >  [<ffffffff8110f58d>] ? kmemleak_alloc+0x83/0x35a
> > > >  [<ffffffff8110f58d>] ? kmemleak_alloc+0x83/0x35a
> > > >  [<ffffffff8110863c>] kmem_cache_alloc+0xac/0x14e
> > > >  [<ffffffff8110f58d>] kmemleak_alloc+0x83/0x35a
> > > >  [<ffffffff812b6436>] ? cfq_get_queue+0x101/0x231
> > > >  [<ffffffff81108511>] kmem_cache_alloc_node+0xf8/0x177
> > > >  [<ffffffff812b6436>] ? cfq_get_queue+0x101/0x231
> > > >  [<ffffffff812b6436>] cfq_get_queue+0x101/0x231
> > > 
> > > Kmemleak needs to allocate memory for the pointer tracing and it
> > > currently passes the same gfp flags as those used by the original
> > > caller. In this case cfq_find_alloc_queue uses __GFP_NOFAIL.
> > > 
> > > The reason for this was to avoid GFP_ATOMIC if the caller wasn't
> > > requiring it. I think the approach below is better:
> > > 
> > 
> > How about defining a GFP_SLAB_KMEMLEAK_MASK the subset of flags that kmemleak
> > should use? Based on this patch, the following appears to be it's definition.
> > 
> > __GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGH
> 
> Do you mean defining one in the gfp.h file? I think this would be better
> placed in the kmemleak.c file as no other part of Linux would be using
> it.
> 

Yes, I meant placing it in the gfp.h file but I don't feel super strongly
about it. Defining it in kmemleak.c is fine too and is easier to read than
placing the mask directly at the call site.

> I personally find defining the GFP_KMEMLEAK_MASK as (GFP_KERNEL |
> GFP_ATOMIC) more readable than using the individual bits since this
> states clearly what type of allocations would be allowed (and safer if
> someone later decides to improve the GFP_KERNEL or GFP_ATOMIC
> definitions).
> 

That's fair enough.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

  reply	other threads:[~2009-06-17 12:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200906162232.n5GMWRZe026963@imap1.linux-foundation.org>
     [not found] ` <20090616223649.719ea378.akpm@linux-foundation.org>
2009-06-17 11:18   ` [PATCH] pagemap: add page-types tool, fix build Ingo Molnar
2009-06-17 11:31     ` WARNING: at mm/page_alloc.c:1159 get_page_from_freelist+0x325/0x655() Ingo Molnar
2009-06-17 11:35       ` Ingo Molnar
2009-06-17 12:19         ` [PATCH] profile: Suppress warning about large allocations when profile=1 is specified Mel Gorman
2009-06-20 10:09           ` Heinz Diehl
2009-06-20 19:50             ` Mel Gorman
2009-06-20 21:48               ` Heinz Diehl
2009-06-22 11:31                 ` Mel Gorman
2009-06-22 13:50                   ` Heinz Diehl
2009-06-22 19:58                     ` Mel Gorman
2009-06-22 17:00                   ` Arnaldo Carvalho de Melo
2009-06-17 11:41       ` WARNING: at mm/page_alloc.c:1159 get_page_from_freelist+0x325/0x655() Mel Gorman
2009-06-17 12:11       ` Catalin Marinas
2009-06-17 12:28         ` Mel Gorman
2009-06-17 12:36           ` Catalin Marinas
2009-06-17 12:40             ` Mel Gorman [this message]
2009-06-17 12:52               ` [PATCH] kmemleak: Only use GFP_KERNEL|GFP_ATOMIC for the internal allocations Catalin Marinas
2009-06-17 13:01                 ` Pekka Enberg
2009-06-17 13:23                   ` Catalin Marinas
2009-06-17 13:30                     ` Pekka Enberg
2009-06-17 15:36                       ` [PATCH] kmemleak: Rename kmemleak_panic to kmemleak_stop Catalin Marinas
2009-06-17 15:37                         ` Pekka Enberg
2009-06-17 17:14                         ` Daniel Walker
2009-06-17 17:27                           ` Catalin Marinas
2009-06-17 16:39       ` WARNING: at mm/page_alloc.c:1159 get_page_from_freelist+0x325/0x655() Linus Torvalds
2009-06-17 16:52         ` Ingo Molnar

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=20090617124034.GE28529@csn.ul.ie \
    --to=mel@csn.ul.ie \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@cs.helsinki.fi \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox