mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: kmemleak: Protect the seq start/next/stop sequence byrcu_read_lock()
Date: Thu, 13 Aug 2009 15:44:40 +0100	[thread overview]
Message-ID: <1250174680.14019.24.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20090813094437.GB22762@elte.hu>

On Thu, 2009-08-13 at 11:44 +0200, Ingo Molnar wrote:
> i still have the full crashlog (attached below) - you can see all 
> the mappings (and other details) in that.
> 
> It's a fairly regular whitebox PC with 1GB of RAM:
> 
> [    0.000000] initial memory mapped : 0 - 20000000
> [    0.000000] init_memory_mapping: 0000000000000000-000000003fff0000
> [    0.000000]  0000000000 - 003fe00000 page 2M
> [    0.000000]  003fe00000 - 003fff0000 page 4k
> [    0.000000] kernel direct mapping tables up to 3fff0000 @ 10000-13000

So the kmemleak fault address 0020000000 should be valid. Is this true
for all contexts? A later message in the log shows this:

> [    0.000000] Mapping aperture over 65536 KB of RAM @ 20000000

This comes from allocate_aperture() in arch/x86/kernel/aperture_64.c.
Does it mean that the kernel direct mapping at 0x20000000 may be
unmapped? Or is it initially mapped and unmapped later, possibly when
kmemleak is scanning the memory?

Since now kmemleak tracks alloc_bootmem() blocks, it will scan the
aperture above as well. An annotation would tell kmemleak to ignore it:

diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 676debf..cb690b3 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -94,6 +94,11 @@ static u32 __init allocate_aperture(void)
 	 * code for safe
 	 */
 	p = __alloc_bootmem_nopanic(aper_size, aper_size, 512ULL<<20);
+	/*
+	 * Kmemleak should not scan this block as it may not be mapped via the
+	 * kernel direct mapping.
+	 */
+	kmemleak_ignore(p);
 	if (!p || __pa(p)+aper_size > 0xffffffff) {
 		printk(KERN_ERR
 			"Cannot allocate aperture memory hole (%p,%uK)\n",

We could as well use kmemleak_no_scan(p) instead of kmemleak_ignore().

Could you please let me know if the patch solves the page fault?

Thanks.

-- 
Catalin


  reply	other threads:[~2009-08-13 14:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29 15:26 [PATCH] kmemleak: Protect the seq start/next/stop sequence by rcu_read_lock() Catalin Marinas
2009-07-30  0:00 ` Andrew Morton
2009-07-30  8:24   ` Catalin Marinas
2009-08-02 11:14 ` Ingo Molnar
2009-08-10 15:55   ` Catalin Marinas
2009-08-10 18:45     ` Ingo Molnar
2009-08-10 22:56       ` Catalin Marinas
2009-08-11  7:32         ` Ingo Molnar
2009-08-11  8:55           ` Catalin Marinas
2009-08-12 12:17             ` Catalin Marinas
2009-08-12 15:32               ` Linus Torvalds
2009-08-12 15:39                 ` Catalin Marinas
2009-08-12 20:52               ` Ingo Molnar
2009-08-12 22:16                 ` kmemleak: Protect the seq start/next/stop sequence byrcu_read_lock() Catalin Marinas
2009-08-13  6:52                   ` Ingo Molnar
2009-08-13  9:39                     ` Catalin Marinas
2009-08-13  9:44                       ` Ingo Molnar
2009-08-13 14:44                         ` Catalin Marinas [this message]
2009-08-14 22:45                 ` Catalin Marinas
2009-08-14 22:47                   ` [PATCH] kmemleak: Allow rescheduling during an object scanning Catalin Marinas
2009-08-14 22:48                   ` [PATCH] kmemleak: Ignore the aperture memory hole on x86_64 Catalin Marinas
2009-08-15 14:17                     ` Ingo Molnar
2009-08-15 22:34                       ` Catalin Marinas
2009-08-16  7:04                         ` Ingo Molnar
2009-08-16 10:08                     ` Ingo Molnar
2009-08-16 21:48                       ` Catalin Marinas

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=1250174680.14019.24.camel@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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

all inboxes | Powered by JetHome®