linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Maxin John <maxin.john@gmail.com>
Cc: Daniel Baluta <dbaluta@ixiacom.com>,
	naveen yadav <yad.naveen@gmail.com>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: kmemleak for MIPS
Date: Tue, 29 Mar 2011 11:40:06 +0100	[thread overview]
Message-ID: <1301395206.583.53.camel@e102109-lin.cambridge.arm.com> (raw)
In-Reply-To: <AANLkTim139fpJsMJFLiyUYvFgGMz-Ljgd_yDrks-tqhE@mail.gmail.com>

On Mon, 2011-03-28 at 22:15 +0100, Maxin John wrote:
> > Just add "depends on MIPS" and give it a try.
> As per your suggestion, I have tried it in my qemu environment (MIPS malta).
> 
> With a minor modification in arch/mips/kernel/vmlinux.lds.S (added the
> symbol  _sdata ), I was able to add kmemleak support for MIPS.
> 
> Output in MIPS (Malta):

You may want to disable the kmemleak testing to reduce the amount of
leaks reported.

> debian-mips:~# uname -a
> Linux debian-mips 2.6.38-08826-g1788c20-dirty #4 SMP Mon Mar 28
> 23:22:04 EEST 2011 mips GNU/Linux
> debian-mips:~# mount -t debugfs nodev /sys/kernel/debug/
> debian-mips:~# cat /sys/kernel/debug/kmemleak
> unreferenced object 0x8f95d000 (size 4096):
>   comm "swapper", pid 1, jiffies 4294937330 (age 467.240s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<80529644>] alloc_large_system_hash+0x2f8/0x410
>     [<8053864c>] udp_table_init+0x4c/0x158
>     [<80538774>] udp_init+0x1c/0x94
>     [<80538b34>] inet_init+0x184/0x2a0
>     [<80100584>] do_one_initcall+0x174/0x1e0
>     [<8051f348>] kernel_init+0xe4/0x174
>     [<80103d4c>] kernel_thread_helper+0x10/0x18
> unreferenced object 0x8f95e000 (size 4096):
>   comm "swapper", pid 1, jiffies 4294937330 (age 467.240s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<80529644>] alloc_large_system_hash+0x2f8/0x410
>     [<8053864c>] udp_table_init+0x4c/0x158
>     [<8053881c>] udplite4_register+0x24/0xa8
>     [<80538b3c>] inet_init+0x18c/0x2a0
>     [<80100584>] do_one_initcall+0x174/0x1e0
>     [<8051f348>] kernel_init+0xe4/0x174
>     [<80103d4c>] kernel_thread_helper+0x10/0x18

These are probably false positives. Since the pointer referring this
block (udp_table) is __read_mostly, is it possible that the
corresponding section gets placed outside the _sdata.._edata range?

diff --git a/arch/mips/include/asm/cache.h b/arch/mips/include/asm/cache.h
index 650ac9b..b4db69f 100644
--- a/arch/mips/include/asm/cache.h
+++ b/arch/mips/include/asm/cache.h
@@ -17,6 +17,6 @@
 #define SMP_CACHE_SHIFT		L1_CACHE_SHIFT
 #define SMP_CACHE_BYTES		L1_CACHE_BYTES
 
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
 
 #endif /* _ASM_CACHE_H */
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 570607b..6f6d5d0 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -74,6 +74,7 @@ SECTIONS
 		INIT_TASK_DATA(PAGE_SIZE)
 		NOSAVE_DATA
 		CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
+		READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
 		DATA_DATA
 		CONSTRUCTORS
 	}

> unreferenced object 0x8f072000 (size 4096):
>   comm "swapper", pid 1, jiffies 4294937680 (age 463.840s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<801ba3d8>] __kmalloc+0x130/0x180
>     [<805461bc>] flow_cache_cpu_prepare+0x50/0xa8
>     [<8053746c>] flow_cache_init_global+0x90/0x138
>     [<80100584>] do_one_initcall+0x174/0x1e0
>     [<8051f348>] kernel_init+0xe4/0x174
>     [<80103d4c>] kernel_thread_helper+0x10/0x18

Same here, flow_cachep pointer is __read_mostly.

-- 
Catalin


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-03-29 10:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 13:54 naveen yadav
2011-03-24  9:27 ` Daniel Baluta
2011-03-24  9:55   ` Catalin Marinas
2011-03-28 21:15     ` Maxin John
2011-03-29 10:40       ` Catalin Marinas [this message]
2011-03-29 11:38         ` Maxin John
2011-03-29 11:50           ` Catalin Marinas
2011-03-29 12:27             ` Maxin John
2011-03-29 19:36               ` Maxin John
2011-03-29 19:54                 ` Daniel Baluta
2011-03-30  9:15                 ` Catalin Marinas
2011-03-30  9:54                   ` Daniel Baluta
2011-03-30  9:58                     ` Catalin Marinas
2011-03-30 11:03                     ` Maxin John
2011-03-30 11:24                       ` Daniel Baluta
2011-03-30 11:38                         ` Catalin Marinas
2011-03-30 12:17                           ` Maxin John
2011-03-30 12:27                             ` Eric Dumazet
2011-03-30 12:40                               ` Maxin John
2011-03-30 12:52                               ` Daniel Baluta
2011-03-30 13:17                                 ` Maxin John
2011-03-30 13:27                                   ` Eric Dumazet
2011-03-30 14:07                                     ` Maxin John
2011-03-30 14:07                                     ` Catalin Marinas
2011-03-30 12:22                         ` Eric Dumazet
2011-03-30 10:08                   ` Maxin John
2011-03-30 14:28                 ` Ralf Baechle
2011-03-30 14:21         ` Ralf Baechle
  -- strict thread matches above, loose matches on Subject: below --
2009-11-02 17:07 Kmemleak for mips Luis R. Rodriguez
2009-11-03  9:23 ` 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=1301395206.583.53.camel@e102109-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=dbaluta@ixiacom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-mm@kvack.org \
    --cc=maxin.john@gmail.com \
    --cc=yad.naveen@gmail.com \
    /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