mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -mm] kmemleak: Fix section mismatch in kmemleak.c
@ 2009-02-14  3:42 Rakib Mullick
  2009-02-18 10:06 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: Rakib Mullick @ 2009-02-14  3:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Ingo Molnar, LKML, Catalin Marinas

 Impact: Section mismatch

The function kmemleak_alloc() is called from kernel allocators.
kmemleak_alloc() calls log_early() but being log_early() marked as
__init it causes following section mismatches. Being called from
kernel allocators, kmemleak_allock() will be called after freeing up
the init memory and log_early() will also called. So, unmarking __init
from log_early() fixes the warning. If anything else please notice.

  LD      mm/built-in.o
WARNING: mm/built-in.o(.text+0x4f371): Section mismatch in reference
from the function kmemleak_alloc() to the function
.init.text:log_early()
The function kmemleak_alloc() references
the function __init log_early().
This is often because kmemleak_alloc lacks a __init
annotation or the annotation of log_early is wrong.

WARNING: mm/built-in.o(.text+0x4f470): Section mismatch in reference
from the function kmemleak_free() to the function
.init.text:log_early()
The function kmemleak_free() references
the function __init log_early().
This is often because kmemleak_free lacks a __init
annotation or the annotation of log_early is wrong.

WARNING: mm/built-in.o(.text+0x4f56f): Section mismatch in reference
from the function kmemleak_not_leak() to the function
.init.text:log_early()
The function kmemleak_not_leak() references
the function __init log_early().
This is often because kmemleak_not_leak lacks a __init
annotation or the annotation of log_early is wrong.

WARNING: mm/built-in.o(.text+0x4f66e): Section mismatch in reference
from the function kmemleak_ignore() to the function
.init.text:log_early()
The function kmemleak_ignore() references
the function __init log_early().
This is often because kmemleak_ignore lacks a __init
annotation or the annotation of log_early is wrong.

WARNING: mm/built-in.o(.text+0x4f786): Section mismatch in reference
from the function kmemleak_scan_area() to the function
.init.text:log_early()
The function kmemleak_scan_area() references
the function __init log_early().
This is often because kmemleak_scan_area lacks a __init
annotation or the annotation of log_early is wrong.

WARNING: mm/built-in.o(.text+0x4f885): Section mismatch in reference
from the function kmemleak_no_scan() to the function
.init.text:log_early()
The function kmemleak_no_scan() references
the function __init log_early().
This is often because kmemleak_no_scan lacks a __init
annotation or the annotation of log_early is wrong.

Thanks.

----
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

--- linus/mm/kmemleak.c	2009-02-13 11:23:55.000000000 +0600
+++ rakib/mm/kmemleak.c	2009-02-13 23:05:45.000000000 +0600
@@ -230,8 +230,8 @@ struct early_log {
 };

 /* early logging buffer and current position */
-static struct early_log __initdata early_log[200];
-static int __initdata crt_early_log;
+static struct early_log early_log[200];
+static int crt_early_log;

 static void kmemleak_disable(void);

@@ -682,7 +682,7 @@ static void object_no_scan(unsigned long
  * Log an early kmemleak_* call to the early_log buffer. These calls will be
  * processed later once kmemleak is fully initialized.
  */
-static void __init log_early(int op_type, const void *ptr, size_t size,
+static void log_early(int op_type, const void *ptr, size_t size,
 			     int min_count,
 			     unsigned long offset, size_t length)
 {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -mm] kmemleak: Fix section mismatch in kmemleak.c
  2009-02-14  3:42 [PATCH -mm] kmemleak: Fix section mismatch in kmemleak.c Rakib Mullick
@ 2009-02-18 10:06 ` Catalin Marinas
  0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2009-02-18 10:06 UTC (permalink / raw)
  To: Rakib Mullick; +Cc: Andrew Morton, Ingo Molnar, LKML

On Sat, 2009-02-14 at 09:42 +0600, Rakib Mullick wrote:
> Impact: Section mismatch
> 
> The function kmemleak_alloc() is called from kernel allocators.
> kmemleak_alloc() calls log_early() but being log_early() marked as
> __init it causes following section mismatches. Being called from
> kernel allocators, kmemleak_allock() will be called after freeing up
> the init memory and log_early() will also called. So, unmarking __init
> from log_early() fixes the warning. If anything else please notice.

Thanks for the patch. There's nothing dangerous as kmemleak takes care
of not using the __init functions after it was initialised but I
couldn't find a way to free these functions/data and also avoid the
warning.

Anyway, that's fine as an interim patch but I think I'll just allocate
some pages dynamically for the early logging buffer so that we can free
them once initialised. I'll update the kmemleak branch sometime this
week.

Thanks.

-- 
Catalin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-18 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-14  3:42 [PATCH -mm] kmemleak: Fix section mismatch in kmemleak.c Rakib Mullick
2009-02-18 10:06 ` Catalin Marinas

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®