* BUG: failure at mm/nommu.c:518/add_nommu_region()
@ 2009-05-05 1:30 Greg Ungerer
2009-05-05 13:41 ` David Howells
0 siblings, 1 reply; 8+ messages in thread
From: Greg Ungerer @ 2009-05-05 1:30 UTC (permalink / raw)
To: David Howells; +Cc: linux-kernel
Hi David,
I am getting this BUG_ON with linux-2.6.30-rc4-git1, that I wasn't
getting with linux-2.6.30-rc3:
uClinux/COLDFIRE(m520x)
COLDFIRE port done by Greg Ungerer, gerg@snapgear.com
Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
Kernel command line: root=/dev/mtdblock0
NR_IRQS:256
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory available: 30160k/32768k RAM, (1144k kernel code, 159k data)
SLUB: Genslabs=13, HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 109.36 BogoMIPS (lpj=546816)
Mount-cache hash table entries: 512
net_namespace: 520 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
ROMFS MTD (C) 2007 Red Hat, Inc.
io scheduler noop registered (default)
ColdFire internal UART serial driver
ttyS0 at MMIO 0xfc060000 (irq = 90) is a ColdFire UART
console [ttyS0] enabled
ttyS1 at MMIO 0xfc064000 (irq = 91) is a ColdFire UART
ttyS2 at MMIO 0xfc068000 (irq = 92) is a ColdFire UART
brd: module loaded
FEC Ethernet Driver
fec: PHY @ 0x1, ID 0x20005c90 -- DP83848
eth0 (fec): not using net_device_ops yet
uclinux[mtd]: RAM probe address=0x40165e98 size=0xdc000
Creating 1 MTD partitions on "RAM":
0x000000000000-0x0000000dc000 : "ROMfs"
TCP cubic registered
NET: Registered protocol family 17
VFS: Mounted root (romfs filesystem) readonly on device 31:0.
Freeing unused kernel memory: 44k freed (0x40150000 - 0x4015a000)
BUG: failure at mm/nommu.c:518/add_nommu_region()!
Kernel panic - not syncing: BUG!
This is on a ColdFire non-MMU target (using ROMfs with MTD backing
store).
Could it be related to the recent changes to mm/nommu.c?
I didn't revert those to see yet...
Removing the BUG_ON() I can boot all the way up, not sure if it
is still a valid check.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: BUG: failure at mm/nommu.c:518/add_nommu_region()
2009-05-05 1:30 BUG: failure at mm/nommu.c:518/add_nommu_region() Greg Ungerer
@ 2009-05-05 13:41 ` David Howells
2009-05-06 2:00 ` Greg Ungerer
0 siblings, 1 reply; 8+ messages in thread
From: David Howells @ 2009-05-05 13:41 UTC (permalink / raw)
To: Greg Ungerer; +Cc: dhowells, linux-kernel
Greg Ungerer <gerg@snapgear.com> wrote:
> BUG: failure at mm/nommu.c:518/add_nommu_region()!
Can you find out some more information about the region in question, perhaps
with the attached patch?
Also if you can check to see whether the region is within the ROMFS image.
David
---
diff --git a/mm/nommu.c b/mm/nommu.c
index cdc6f60..ba9e230 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -515,7 +515,18 @@ static void add_nommu_region(struct vm_region *region)
validate_nommu_regions();
- BUG_ON(region->vm_start & ~PAGE_MASK);
+ if (region->vm_start & ~PAGE_MASK) {
+ printk(KERN_ERR "___ REGION ERROR ___\n");
+ printk(KERN_ERR "%lx-%lx\n", region->vm_start, region->vm_end);
+ printk(KERN_ERR "fs=%s file=%s\n",
+ region->vm_file ?
+ region->vm_file->f_path.dentry->d_inode->i_sb->s_type->name :
+ "*anon*",
+ region->vm_file ?
+ region->vm_file->f_path.dentry->d_name.name :
+ (const unsigned char *) "*anon*");
+ BUG();
+ }
parent = NULL;
p = &nommu_region_tree.rb_node;
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: BUG: failure at mm/nommu.c:518/add_nommu_region()
2009-05-05 13:41 ` David Howells
@ 2009-05-06 2:00 ` Greg Ungerer
2009-05-06 11:21 ` David Howells
2009-05-06 14:11 ` David Howells
0 siblings, 2 replies; 8+ messages in thread
From: Greg Ungerer @ 2009-05-06 2:00 UTC (permalink / raw)
To: David Howells; +Cc: linux-kernel
Hi David,
David Howells wrote:
> Greg Ungerer <gerg@snapgear.com> wrote:
>
>> BUG: failure at mm/nommu.c:518/add_nommu_region()!
>
> Can you find out some more information about the region in question, perhaps
> with the attached patch?
Yep, last part of the boot log now:
...
uclinux[mtd]: RAM probe address=0x168fc0 size=0xd7000
Creating 1 MTD partitions on "RAM":
0x000000000000-0x0000000d7000 : "ROMfs"
TCP cubic registered
NET: Registered protocol family 17
VFS: Mounted root (romfs filesystem) readonly on device 31:0.
Freeing unused kernel memory: 44k freed (0x152000 - 0x15c000)
___ REGION ERROR ___
18b790-191db0
fs=romfs file=init
BUG: failure at mm/nommu.c:532/add_nommu_region()!
Kernel panic - not syncing: BUG!
> Also if you can check to see whether the region is within the ROMFS image.
Yes, it is. As per the uclinux/mtd trace output (at top of trace
above). The start physical address of the ROMFS is 0x168fc0, and
it will end at 0x23ffc0.
Regards
Greg
> David
> ---
> diff --git a/mm/nommu.c b/mm/nommu.c
> index cdc6f60..ba9e230 100644
> --- a/mm/nommu.c
> +++ b/mm/nommu.c
> @@ -515,7 +515,18 @@ static void add_nommu_region(struct vm_region *region)
>
> validate_nommu_regions();
>
> - BUG_ON(region->vm_start & ~PAGE_MASK);
> + if (region->vm_start & ~PAGE_MASK) {
> + printk(KERN_ERR "___ REGION ERROR ___\n");
> + printk(KERN_ERR "%lx-%lx\n", region->vm_start, region->vm_end);
> + printk(KERN_ERR "fs=%s file=%s\n",
> + region->vm_file ?
> + region->vm_file->f_path.dentry->d_inode->i_sb->s_type->name :
> + "*anon*",
> + region->vm_file ?
> + region->vm_file->f_path.dentry->d_name.name :
> + (const unsigned char *) "*anon*");
> + BUG();
> + }
>
> parent = NULL;
> p = &nommu_region_tree.rb_node;
>
--
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: BUG: failure at mm/nommu.c:518/add_nommu_region()
2009-05-06 2:00 ` Greg Ungerer
@ 2009-05-06 11:21 ` David Howells
2009-05-06 14:11 ` David Howells
1 sibling, 0 replies; 8+ messages in thread
From: David Howells @ 2009-05-06 11:21 UTC (permalink / raw)
To: Greg Ungerer; +Cc: dhowells, linux-kernel
Greg Ungerer <gerg@snapgear.com> wrote:
> ___ REGION ERROR ___
> 18b790-191db0
> fs=romfs file=init
> BUG: failure at mm/nommu.c:532/add_nommu_region()!
> Kernel panic - not syncing: BUG!
>
>
> > Also if you can check to see whether the region is within the ROMFS image.
>
> Yes, it is. As per the uclinux/mtd trace output (at top of trace
> above). The start physical address of the ROMFS is 0x168fc0, and
> it will end at 0x23ffc0.
Okay... XIP regions must avoid the check.
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: BUG: failure at mm/nommu.c:518/add_nommu_region()
2009-05-06 2:00 ` Greg Ungerer
2009-05-06 11:21 ` David Howells
@ 2009-05-06 14:11 ` David Howells
2009-05-07 0:13 ` Greg Ungerer
1 sibling, 1 reply; 8+ messages in thread
From: David Howells @ 2009-05-06 14:11 UTC (permalink / raw)
To: Greg Ungerer; +Cc: dhowells, linux-kernel
Can you try the attached patch, please?
David
---
From: David Howells <dhowells@redhat.com>
Subject: [PATCH] NOMMU: Don't check vm_region::vm_start is page aligned in add_nommu_region()
Don't check vm_region::vm_start is page aligned in add_nommu_region() because
the region may reflect some non-page-aligned mapped file, such as could be
obtained from RomFS XIP.
Signed-off-by: David Howells <dhowells@redhat.com>
---
mm/nommu.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/mm/nommu.c b/mm/nommu.c
index cdc6f60..325706b 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -515,8 +515,6 @@ static void add_nommu_region(struct vm_region *region)
validate_nommu_regions();
- BUG_ON(region->vm_start & ~PAGE_MASK);
-
parent = NULL;
p = &nommu_region_tree.rb_node;
while (*p) {
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: BUG: failure at mm/nommu.c:518/add_nommu_region()
2009-05-06 14:11 ` David Howells
@ 2009-05-07 0:13 ` Greg Ungerer
2009-05-07 8:38 ` David Howells
0 siblings, 1 reply; 8+ messages in thread
From: Greg Ungerer @ 2009-05-07 0:13 UTC (permalink / raw)
To: David Howells; +Cc: linux-kernel
Hi David,
David Howells wrote:
> Can you try the attached patch, please?
Yes, that fixes it :-)
Regards
Greg
> ---
> From: David Howells <dhowells@redhat.com>
> Subject: [PATCH] NOMMU: Don't check vm_region::vm_start is page aligned in add_nommu_region()
>
> Don't check vm_region::vm_start is page aligned in add_nommu_region() because
> the region may reflect some non-page-aligned mapped file, such as could be
> obtained from RomFS XIP.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
>
> mm/nommu.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
>
> diff --git a/mm/nommu.c b/mm/nommu.c
> index cdc6f60..325706b 100644
> --- a/mm/nommu.c
> +++ b/mm/nommu.c
> @@ -515,8 +515,6 @@ static void add_nommu_region(struct vm_region *region)
>
> validate_nommu_regions();
>
> - BUG_ON(region->vm_start & ~PAGE_MASK);
> -
> parent = NULL;
> p = &nommu_region_tree.rb_node;
> while (*p) {
>
--
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: BUG: failure at mm/nommu.c:518/add_nommu_region()
2009-05-07 0:13 ` Greg Ungerer
@ 2009-05-07 8:38 ` David Howells
2009-05-07 8:45 ` Greg Ungerer
0 siblings, 1 reply; 8+ messages in thread
From: David Howells @ 2009-05-07 8:38 UTC (permalink / raw)
To: Greg Ungerer; +Cc: dhowells, linux-kernel
Greg Ungerer <gerg@snapgear.com> wrote:
> Yes, that fixes it :-)
Can I add your Acked-by or Tested-by?
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: BUG: failure at mm/nommu.c:518/add_nommu_region()
2009-05-07 8:38 ` David Howells
@ 2009-05-07 8:45 ` Greg Ungerer
0 siblings, 0 replies; 8+ messages in thread
From: Greg Ungerer @ 2009-05-07 8:45 UTC (permalink / raw)
To: David Howells; +Cc: linux-kernel
Hi David,
David Howells wrote:
> Greg Ungerer <gerg@snapgear.com> wrote:
>
>> Yes, that fixes it :-)
>
> Can I add your Acked-by or Tested-by?
Yes, absolutely:
Acked-by: Greg Ungerer <gerg@uclinux.org>
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-05-07 8:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05 1:30 BUG: failure at mm/nommu.c:518/add_nommu_region() Greg Ungerer
2009-05-05 13:41 ` David Howells
2009-05-06 2:00 ` Greg Ungerer
2009-05-06 11:21 ` David Howells
2009-05-06 14:11 ` David Howells
2009-05-07 0:13 ` Greg Ungerer
2009-05-07 8:38 ` David Howells
2009-05-07 8:45 ` Greg Ungerer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox