Skip to contentSkip to conversation

2.6.21-rc4-mm1 + 3 hot-fixes -- WARNING: could not find versions for .tmp_versions/built-in.mod

DISCUSSION Miles Lane 4 participants 7 messages Mar 20, 2007 – Mar 29, 2007

Subsystems (4)
lore
Share & tools
lore

Miles Lane

author
#0 lore raw

It looks like the number of section mismatches is much reduced, which is great. But, I don't remember seeing "WARNING: could not find versions for ..." warnings before. Is this an artifact of the init/.missing_syscalls.h problem I encountered earlier?

MODPOST vmlinux
WARNING: could not find versions for .tmp_versions/head.mod
WARNING: could not find versions for .tmp_versions/init_task.mod
WARNING: init/built-in.o - Section mismatch: reference to .init.text:
from .text between 'rest_init' (at offset 0x101) and 'try_name'
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15c8f) and '__section_nr'
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15d02) and '__section_nr'
WARNING: mm/built-in.o - Section mismatch: reference to .init.data:initkmem_list3 from .text between 'set_up_list3s' (at offset 0x18c32) and 's_start'
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod

maintainer
#1 lore raw
Quoted 2 lines · On Tue, 20 Mar 2007 07:35:06 -0700 "Miles Lane" <[email protected]> wrote:

It looks like the number of section mismatches is much reduced, which is great.

We fixed something? Maybe we just broke the checker ;)

Quoted 3 lines

But, I don't remember seeing "WARNING: could not find
versions for ..." warnings before. Is this an artifact of the init/.missing_syscalls.h problem I encountered earlier?

Sam says these are harmless and he's working on making them go away.

Quoted 3 lines

MODPOST vmlinux
WARNING: could not find versions for .tmp_versions/head.mod
WARNING: could not find versions for .tmp_versions/init_task.mod

#2 lore raw
Quoted 5 lines · Andrew Morton
Quoted 2 lines · On Tue, 20 Mar 2007 07:35:06 -0700 "Miles Lane" <[email protected]> wrote:

It looks like the number of section mismatches is much reduced, which is great.

Quoted 11 lines

We fixed something? Maybe we just broke the checker ;)

Quoted 3 lines

But, I don't remember seeing "WARNING: could not find
versions for ..." warnings before. Is this an artifact of the init/.missing_syscalls.h problem I encountered earlier?

Sam says these are harmless and he's working on making them go away.

Quoted 3 lines

MODPOST vmlinux
WARNING: could not find versions for .tmp_versions/head.mod
WARNING: could not find versions for .tmp_versions/init_task.mod

They were caused by modpost now being called with several .o files that are not modules. The fix was just to get rid of the warning.
I have committed the following to kbuild.git.

Sam

commit 84b48a0275b4474587cefecb455372e8df6dabda

Author: Sam Ravnborg <[email protected]>
Date:   Tue Mar 20 21:30:23 2007 +0100

kbuild: do not emit src version warning for non-modules

modpost is now called with .o files that are not modules. So do not warn if there is no corresponding .mod file listing .o files (in .tmp_versions/).

scripts/mod/sumversion.c +2 -3
index 8a28756..6873d5a 100644
@@ -397,10 +397,9 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
 		(int) strlen(basename) - 2, basename);
 
 	file = grab_file(filelist, &len);
-	if (!file) {
-		warn("could not find versions for %s\n", filelist);
+	if (!file)
+		/* not a module or .mod file missing - ignore */
 		return;
-	}
 
 	sources = strchr(file, '\n');
 	if (!sources) {
#3 lore raw
In reply to Miles Lane
Quoted 10 lines · Miles Lane

It looks like the number of section mismatches is much reduced, which is great. But, I don't remember seeing "WARNING: could not find versions for ..." warnings before. Is this an artifact of the init/.missing_syscalls.h problem I encountered earlier?

MODPOST vmlinux
WARNING: could not find versions for .tmp_versions/head.mod
WARNING: could not find versions for .tmp_versions/init_task.mod
WARNING: init/built-in.o - Section mismatch: reference to .init.text:
from .text between 'rest_init' (at offset 0x101) and 'try_name'

I do not see this one - but then I do not build the -mm tree. Will chase it later if no-one beats me.

Quoted 9 lines

WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: could not find versions for .tmp_versions/built-in.mod
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15c8f) and '__section_nr'

I took a look at this one.
You have SPARSEMEM enabled in your config.
And then I see that in sparse.c we call alloc_bootmem_node() from a function I thought should be marked __devinit (it is used by memory_hotplug.c).
But I am not familiar enough to judge if __alloc_bootmen_node are marked correct with __init or __devinit (to say this is used in the HOTPLUG case) is more correct. Anyone?

Quoted 3 lines

WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15d02) and '__section_nr'

Same as above....

Quoted 3 lines

WARNING: mm/built-in.o - Section mismatch: reference to .init.data:initkmem_list3 from .text between 'set_up_list3s' (at offset 0x18c32) and 's_start'

This one I have also tried to track down. But my
slab knowledge was not enough to fix it :-(

Sam

#4 lore raw

Hello.

Quoted 13 lines
Quoted 3 lines

WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15c8f) and '__section_nr'

I took a look at this one.
You have SPARSEMEM enabled in your config.
And then I see that in sparse.c we call alloc_bootmem_node() from a function I thought should be marked __devinit (it is used by memory_hotplug.c).
But I am not familiar enough to judge if __alloc_bootmen_node are marked correct with __init or __devinit (to say this is used in the HOTPLUG case) is more correct. Anyone?

Quoted 4 lines
Quoted 3 lines

WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15d02) and '__section_nr'

Same as above....

Memory hotplug code has __meminit for its purpose.
But, I suspect that many other places of memory hotplug code may have same issue. I will chase them.

BTW, does -mm code checks more strict than stock kernel? I can't see these warnings in 2.6.21-rc4.....

Bye.

Signature · 1 line
Yasunori Goto 
#5 lore raw
Quoted 15 lines · Yasunori Goto

Hello.

Quoted 13 lines
Quoted 3 lines

WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15c8f) and '__section_nr'

I took a look at this one.
You have SPARSEMEM enabled in your config.
And then I see that in sparse.c we call alloc_bootmem_node() from a function I thought should be marked __devinit (it is used by memory_hotplug.c).
But I am not familiar enough to judge if __alloc_bootmen_node are marked correct with __init or __devinit (to say this is used in the HOTPLUG case) is more correct. Anyone?

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15d02) and '__section_nr'

Same as above....

Memory hotplug code has __meminit for its purpose.
But, I suspect that many other places of memory hotplug code may have same issue. I will chase them.

Thanks!

Quoted 3 lines

BTW, does -mm code checks more strict than stock kernel? I can't see these warnings in 2.6.21-rc4.....

Yes it does. The included kbuild changes enables proper check of symbols in vmlinux.

Sam

#6 lore raw

[RFC:PATCH]regster memory init functions into white list of section mismatch.

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 4 lines

WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15c8f) and '__section_nr'

I took a look at this one.
You have SPARSEMEM enabled in your config.
And then I see that in sparse.c we call alloc_bootmem_node() from a function I thought should be marked __devinit (it is used by memory_hotplug.c).
But I am not familiar enough to judge if __alloc_bootmen_node are marked correct with __init or __devinit (to say this is used in the HOTPLUG case) is more correct. Anyone?

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

WARNING: mm/built-in.o - Section mismatch: reference to .init.text:__alloc_bootmem_node from .text between 'sparse_init' (at offset 0x15d02) and '__section_nr'

Same as above....

Memory hotplug code has __meminit for its purpose.
But, I suspect that many other places of memory hotplug code may have same issue. I will chase them.

Hello.

I chased section mismatch codes on memory hotplug code. Many of them should be defined as __meminit. (This check was great helpful for checking it. Thanks!)
But, I would like to add a new pattern in white list for some of them. (I'll post another patch for others.)

sparse.c (sparse_index_alloc()) calles alloc_bootmem_node() as you mentioned. And, zone_wait_table_init() calles it too.
These functions call it on only boot time, and call vmalloc()/kmalloc() on hotplug time. It is distinguished by system_state value or slab_is_available(). Just refrerences remain at them after boot.

Bootmem allocation functions are called by many functions and it must be used only at boot time. I think __init of them should keep for section mismatch check. So, I would like to register sparse_index_alloc() and zone_wait_table_init() into white list.

Please comment. If there is a more good way, please let me know...

Thanks.

P.S.
Pattarn 10 is for ia64 (not for memory hotplug).
ia64's .machvec section is mixture table of .init functions and normal text. It is defined for platform dependent functions. This is also cause of warnings. I think this should be registered too.

---
 mm/page_alloc.c       |    2 +-
 mm/sparse.c           |    2 +-
 scripts/mod/modpost.c |   29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 2 deletions(-)
scripts/mod/modpost.c +29 -0
Index: current_test/scripts/mod/modpost.c
===================================================================
@@ -643,6 +643,17 @@ static int strrcmp(const char *s, const 
  *  The pattern is:
  *  tosec    = .init.text
  *  fromsec  = __ksymtab*
+ *
+ * Pattern 9:
+ *  Some of functions are common code between boot time and hotplug
+ *  time. The bootmem allocater is called only boot time in its
+ *  functions. So it's ok to reference.
+ *  tosec    = .init.text
+ *
+ * Pattern 10:
+ *  ia64 has machvec table for each platform. It is mixture of function
+ *  pointer of .init.text and .text.
+ *  fromsec  = .machvec
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
 			    const char *fromsec, const char *atsym,
@@ -669,6 +680,12 @@ static int secref_whitelist(const char *
 		NULL
 	};
 
+	const char *pat4sym[] = {
+		"sparse_index_alloc",
+		"zone_wait_table_init",
+		NULL
+	};
+
 	/* Check for pattern 1 */
 	if (strcmp(tosec, ".init.data") != 0)
 		f1 = 0;
@@ -725,6 +742,18 @@ static int secref_whitelist(const char *
 	if ((strcmp(tosec, ".init.text") == 0) &&
 	    (strncmp(fromsec, "__ksymtab", strlen("__ksymtab")) == 0))
 		return 1;
+
+	/* Check for pattern 9 */
+	if ((strcmp(tosec, ".init.text") == 0) &&
+	    (strcmp(fromsec, ".text") == 0))
+		for (s = pat4sym; *s; s++)
+			if (strcmp(atsym, *s) == 0)
+				return 1;
+
+	/* Check for pattern 10 */
+	if (strcmp(fromsec, ".machvec") == 0)
+		return 1;
+
 	return 0;
 }
 
mm/page_alloc.c +1 -1
Index: current_test/mm/page_alloc.c
===================================================================
@@ -2673,7 +2673,7 @@ void __init setup_per_cpu_pageset(void)
 
 #endif
 
-static __meminit
+static __meminit noinline
 int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
 {
 	int i;
mm/sparse.c +1 -1
Index: current_test/mm/sparse.c
===================================================================
@@ -44,7 +44,7 @@ EXPORT_SYMBOL(page_to_nid);
 #endif
 
 #ifdef CONFIG_SPARSEMEM_EXTREME
-static struct mem_section *sparse_index_alloc(int nid)
+static struct mem_section noinline *sparse_index_alloc(int nid)
 {
 	struct mem_section *section = NULL;
 	unsigned long array_size = SECTIONS_PER_ROOT *
Signature · 1 line
Yasunori Goto