[powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

11 messages, 2 authors, 2009-11-18 · open the first message on its own page

[powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: Sachin Sant <hidden>
Date: 2009-11-02 09:12:25

Stephen Rothwell wrote:
Hi all,

Changes since 20091030:
  
Today's next tree failed to boot on a POWER 6 box with :

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2135!
Oops: Exception in kernel mode, sig: 5 [#2]
SMP NR_CPUS=1024 NUMA pSeries
Modules linked in: ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c00000000014e30c LR: c00000000014e2f8 CTR: c00000000014db88
REGS: c0000000db703620 TRAP: 0700   Tainted: G      D     (2.6.32-rc5-autotest-next-20091102)
MSR: 8000000000029032 <EE,ME,CE,IR,DR>  CR: 24022442  XER: 2000000c
TASK = c0000000db7f6fe0[76] 'init' THREAD: c0000000db700000 CPU: 1
GPR00: 0000000000000001 c0000000db7038a0 c000000000b19900 0000000000000000
GPR04: c0000000db406a40 000000000000000c c0000000fe10c370 c000000000bb2800
GPR08: 000000000000db40 0000000000000000 c0000000dfdc0e00 000000000000000c
GPR12: 0000000044022442 c000000000bb2800 00000000ffffffff ffffffffffffffff
GPR16: 0000000008430000 00000000003c0000 c0000000db703ea0 c0000000db569108
GPR20: c0000000db568908 0000000000000000 c0000000db703d60 0000000000000000
GPR24: 0000000000000001 0000000000040100 c0000000fe503580 c0000000db1ac180
GPR28: 0000000000000000 c000000000f812d0 c000000000a84f00 0000000000000000
NIP [c00000000014e30c] .exit_mmap+0x190/0x1b8
LR [c00000000014e2f8] .exit_mmap+0x17c/0x1b8
Call Trace:
[c0000000db7038a0] [c00000000014e2f8] .exit_mmap+0x17c/0x1b8 (unreliable)
[c0000000db703950] [c0000000000916cc] .mmput+0x54/0x164
[c0000000db7039e0] [c0000000000968d8] .exit_mm+0x17c/0x1a0
[c0000000db703a90] [c000000000098cb8] .do_exit+0x248/0x784
[c0000000db703b70] [c0000000000992a8] .do_group_exit+0xb4/0xe8
[c0000000db703c00] [c0000000000aca2c] .get_signal_to_deliver+0x3ec/0x478
[c0000000db703cf0] [c0000000000134ac] .do_signal+0x6c/0x31c
[c0000000db703e30] [c000000000008b7c] do_work+0x24/0x28
Instruction dump:
7c8407b4 387d0018 4800ab11 60000000 939d0008 7fe3fb78 4bfffdbd 7c7f1b79
4082fff4 e81b00e8 3120ffff 7c090110 <0b000000> 382100b0 e8010010 eb61ffd8
---[ end trace ec052ac77a8e7cb4 ]---
Fixing recursive fault but reboot is needed!

mm/mmap.c:2135 corresponds to :

BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);

3:mon> di 0xc00000000014e300
c00000000014e300  e81b00e8      ld      r0,232(r27)
c00000000014e304  3120ffff      addic   r9,r0,-1
c00000000014e308  7c090110      subfe   r0,r9,r0
c00000000014e30c  0b000000      tdnei   r0,0
c00000000014e310  382100b0      addi    r1,r1,176
c00000000014e314  e8010010      ld      r0,16(r1)
c00000000014e318  eb61ffd8      ld      r27,-40(r1)
c00000000014e31c  7c0803a6      mtlr    r0
c00000000014e320  eb81ffe0      ld      r28,-32(r1)
c00000000014e324  eba1ffe8      ld      r29,-24(r1)
c00000000014e328  ebc1fff0      ld      r30,-16(r1)
c00000000014e32c  ebe1fff8      ld      r31,-8(r1)
c00000000014e330  4e800020      blr
c00000000014e334  fb21ffc8      std     r25,-56(r1)
c00000000014e338  7c0802a6      mflr    r0
c00000000014e33c  fb81ffe0      std     r28,-32(r1)
3:mon> r
R00 = 0000000000000001   R16 = 0000000030daf420
R01 = c0000000fae37a60   R17 = 0000000000000002
R02 = c000000000b19900   R18 = 0000000000000000
R03 = 0000000000000000   R19 = 0000000030d903b0
R04 = c0000000fabd8670   R20 = 0000000000000000
R05 = c000000000a4d600   R21 = 0000000000000000
R06 = 0000000000000003   R22 = 0000000000000000
R07 = c000000000bb2c00   R23 = 0000000030daf340
R08 = 000000000000fabd   R24 = 0000000000000001
R09 = 0000000000000000   R25 = 00000fffc2402158
R10 = c0000000fffb2958   R26 = 00000fffb793df80
R11 = 0000000000000005   R27 = c0000000fa9aa580
R12 = 0000000044000442   R28 = 0000000000000000
R13 = c000000000bb2c00   R29 = c000000000fc12d0
R14 = 00000000ffffffff   R30 = c000000000a84f00
R15 = ffffffffffffffff   R31 = 0000000000000000
pc  = c00000000014e30c .exit_mmap+0x190/0x1b8
lr  = c00000000014e2f8 .exit_mmap+0x17c/0x1b8
msr = 8000000000029032   cr  = 24000442
ctr = c0000000002f0cb0   xer = 000000002000000a   trap =  700
3:mon>

Have attached the boot log. Next tree for 20091030 worked fine.

Thanks
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: Sachin Sant <hidden>
Date: 2009-11-04 12:38:43

Sachin Sant wrote:
Today's next tree failed to boot on a POWER 6 box with :

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2135!
Oops: Exception in kernel mode, sig: 5 [#2]
SMP NR_CPUS=1024 NUMA pSeries
Problem exists with today's next as well.

Likely cause for this problem seems to the following commit.
If i revert this patch the machine boots fine.

commit a0668cdc154e54bf0c85182e0535eea237d53146
powerpc/mm: Cleanup management of kmem_caches for pagetables

Thanks
-Sachin
Modules linked in: ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c00000000014e30c LR: c00000000014e2f8 CTR: c00000000014db88
REGS: c0000000db703620 TRAP: 0700   Tainted: G      D     
(2.6.32-rc5-autotest-next-20091102)
MSR: 8000000000029032 <EE,ME,CE,IR,DR>  CR: 24022442  XER: 2000000c
TASK = c0000000db7f6fe0[76] 'init' THREAD: c0000000db700000 CPU: 1
GPR00: 0000000000000001 c0000000db7038a0 c000000000b19900 
0000000000000000
GPR04: c0000000db406a40 000000000000000c c0000000fe10c370 
c000000000bb2800
GPR08: 000000000000db40 0000000000000000 c0000000dfdc0e00 
000000000000000c
GPR12: 0000000044022442 c000000000bb2800 00000000ffffffff 
ffffffffffffffff
GPR16: 0000000008430000 00000000003c0000 c0000000db703ea0 
c0000000db569108
GPR20: c0000000db568908 0000000000000000 c0000000db703d60 
0000000000000000
GPR24: 0000000000000001 0000000000040100 c0000000fe503580 
c0000000db1ac180
GPR28: 0000000000000000 c000000000f812d0 c000000000a84f00 
0000000000000000
NIP [c00000000014e30c] .exit_mmap+0x190/0x1b8
LR [c00000000014e2f8] .exit_mmap+0x17c/0x1b8
Call Trace:
[c0000000db7038a0] [c00000000014e2f8] .exit_mmap+0x17c/0x1b8 (unreliable)
[c0000000db703950] [c0000000000916cc] .mmput+0x54/0x164
[c0000000db7039e0] [c0000000000968d8] .exit_mm+0x17c/0x1a0
[c0000000db703a90] [c000000000098cb8] .do_exit+0x248/0x784
[c0000000db703b70] [c0000000000992a8] .do_group_exit+0xb4/0xe8
[c0000000db703c00] [c0000000000aca2c] .get_signal_to_deliver+0x3ec/0x478
[c0000000db703cf0] [c0000000000134ac] .do_signal+0x6c/0x31c
[c0000000db703e30] [c000000000008b7c] do_work+0x24/0x28
Instruction dump:
7c8407b4 387d0018 4800ab11 60000000 939d0008 7fe3fb78 4bfffdbd 7c7f1b79
4082fff4 e81b00e8 3120ffff 7c090110 <0b000000> 382100b0 e8010010 eb61ffd8
---[ end trace ec052ac77a8e7cb4 ]---
Fixing recursive fault but reboot is needed!

mm/mmap.c:2135 corresponds to :

BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: David Gibson <hidden>
Date: 2009-11-05 00:16:49

On Wed, Nov 04, 2009 at 06:08:44PM +0530, Sachin Sant wrote:
Sachin Sant wrote:
quoted
Today's next tree failed to boot on a POWER 6 box with :

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2135!
Oops: Exception in kernel mode, sig: 5 [#2]
SMP NR_CPUS=1024 NUMA pSeries
Problem exists with today's next as well.

Likely cause for this problem seems to the following commit.
If i revert this patch the machine boots fine.

commit a0668cdc154e54bf0c85182e0535eea237d53146
powerpc/mm: Cleanup management of kmem_caches for pagetables
Ugh.  Ok, it's not at all obvious how my patch could cause this bug.
Can you send your .config?
quoted
Modules linked in: ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c00000000014e30c LR: c00000000014e2f8 CTR: c00000000014db88
REGS: c0000000db703620 TRAP: 0700   Tainted: G      D
(2.6.32-rc5-autotest-next-20091102)
MSR: 8000000000029032 <EE,ME,CE,IR,DR>  CR: 24022442  XER: 2000000c
TASK = c0000000db7f6fe0[76] 'init' THREAD: c0000000db700000 CPU: 1
GPR00: 0000000000000001 c0000000db7038a0 c000000000b19900
0000000000000000
GPR04: c0000000db406a40 000000000000000c c0000000fe10c370
c000000000bb2800
GPR08: 000000000000db40 0000000000000000 c0000000dfdc0e00
000000000000000c
GPR12: 0000000044022442 c000000000bb2800 00000000ffffffff
ffffffffffffffff
GPR16: 0000000008430000 00000000003c0000 c0000000db703ea0
c0000000db569108
GPR20: c0000000db568908 0000000000000000 c0000000db703d60
0000000000000000
GPR24: 0000000000000001 0000000000040100 c0000000fe503580
c0000000db1ac180
GPR28: 0000000000000000 c000000000f812d0 c000000000a84f00
0000000000000000
NIP [c00000000014e30c] .exit_mmap+0x190/0x1b8
LR [c00000000014e2f8] .exit_mmap+0x17c/0x1b8
Call Trace:
[c0000000db7038a0] [c00000000014e2f8] .exit_mmap+0x17c/0x1b8 (unreliable)
[c0000000db703950] [c0000000000916cc] .mmput+0x54/0x164
[c0000000db7039e0] [c0000000000968d8] .exit_mm+0x17c/0x1a0
[c0000000db703a90] [c000000000098cb8] .do_exit+0x248/0x784
[c0000000db703b70] [c0000000000992a8] .do_group_exit+0xb4/0xe8
[c0000000db703c00] [c0000000000aca2c] .get_signal_to_deliver+0x3ec/0x478
[c0000000db703cf0] [c0000000000134ac] .do_signal+0x6c/0x31c
[c0000000db703e30] [c000000000008b7c] do_work+0x24/0x28
Instruction dump:
7c8407b4 387d0018 4800ab11 60000000 939d0008 7fe3fb78 4bfffdbd 7c7f1b79
4082fff4 e81b00e8 3120ffff 7c090110 <0b000000> 382100b0 e8010010 eb61ffd8
---[ end trace ec052ac77a8e7cb4 ]---
Fixing recursive fault but reboot is needed!

mm/mmap.c:2135 corresponds to :

BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: Sachin Sant <hidden>
Date: 2009-11-05 04:42:50

David Gibson wrote:
On Wed, Nov 04, 2009 at 06:08:44PM +0530, Sachin Sant wrote:
  
quoted
Sachin Sant wrote:
    
quoted
Today's next tree failed to boot on a POWER 6 box with :

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2135!
Oops: Exception in kernel mode, sig: 5 [#2]
SMP NR_CPUS=1024 NUMA pSeries
      
Problem exists with today's next as well.

Likely cause for this problem seems to the following commit.
If i revert this patch the machine boots fine.

commit a0668cdc154e54bf0c85182e0535eea237d53146
powerpc/mm: Cleanup management of kmem_caches for pagetables
    
Ugh.  Ok, it's not at all obvious how my patch could cause this bug.
Can you send your .config?
  
Attached here is the config.

Thanks
-Sachin


-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: Sachin Sant <hidden>
Date: 2009-11-12 11:16:43

David Gibson wrote:
On Wed, Nov 04, 2009 at 06:08:44PM +0530, Sachin Sant wrote:
  
quoted
Sachin Sant wrote:
    
quoted
Today's next tree failed to boot on a POWER 6 box with :

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2135!
Oops: Exception in kernel mode, sig: 5 [#2]
SMP NR_CPUS=1024 NUMA pSeries
      
Problem exists with today's next as well.

Likely cause for this problem seems to the following commit.
If i revert this patch the machine boots fine.

commit a0668cdc154e54bf0c85182e0535eea237d53146
powerpc/mm: Cleanup management of kmem_caches for pagetables
    
Ugh.  Ok, it's not at all obvious how my patch could cause this bug.
Can you send your .config?

  
Still present in today's next. 

Thanks
-Sachin
quoted
quoted
Modules linked in: ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c00000000014e30c LR: c00000000014e2f8 CTR: c00000000014db88
REGS: c0000000db703620 TRAP: 0700   Tainted: G      D
(2.6.32-rc5-autotest-next-20091102)
MSR: 8000000000029032 <EE,ME,CE,IR,DR>  CR: 24022442  XER: 2000000c
TASK = c0000000db7f6fe0[76] 'init' THREAD: c0000000db700000 CPU: 1
GPR00: 0000000000000001 c0000000db7038a0 c000000000b19900
0000000000000000
GPR04: c0000000db406a40 000000000000000c c0000000fe10c370
c000000000bb2800
GPR08: 000000000000db40 0000000000000000 c0000000dfdc0e00
000000000000000c
GPR12: 0000000044022442 c000000000bb2800 00000000ffffffff
ffffffffffffffff
GPR16: 0000000008430000 00000000003c0000 c0000000db703ea0
c0000000db569108
GPR20: c0000000db568908 0000000000000000 c0000000db703d60
0000000000000000
GPR24: 0000000000000001 0000000000040100 c0000000fe503580
c0000000db1ac180
GPR28: 0000000000000000 c000000000f812d0 c000000000a84f00
0000000000000000
NIP [c00000000014e30c] .exit_mmap+0x190/0x1b8
LR [c00000000014e2f8] .exit_mmap+0x17c/0x1b8
Call Trace:
[c0000000db7038a0] [c00000000014e2f8] .exit_mmap+0x17c/0x1b8 (unreliable)
[c0000000db703950] [c0000000000916cc] .mmput+0x54/0x164
[c0000000db7039e0] [c0000000000968d8] .exit_mm+0x17c/0x1a0
[c0000000db703a90] [c000000000098cb8] .do_exit+0x248/0x784
[c0000000db703b70] [c0000000000992a8] .do_group_exit+0xb4/0xe8
[c0000000db703c00] [c0000000000aca2c] .get_signal_to_deliver+0x3ec/0x478
[c0000000db703cf0] [c0000000000134ac] .do_signal+0x6c/0x31c
[c0000000db703e30] [c000000000008b7c] do_work+0x24/0x28
Instruction dump:
7c8407b4 387d0018 4800ab11 60000000 939d0008 7fe3fb78 4bfffdbd 7c7f1b79
4082fff4 e81b00e8 3120ffff 7c090110 <0b000000> 382100b0 e8010010 eb61ffd8
---[ end trace ec052ac77a8e7cb4 ]---
Fixing recursive fault but reboot is needed!

mm/mmap.c:2135 corresponds to :

BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);

      
  

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: David Gibson <hidden>
Date: 2009-11-13 01:37:29

On Thu, Nov 12, 2009 at 04:46:40PM +0530, Sachin Sant wrote:
David Gibson wrote:
quoted
On Wed, Nov 04, 2009 at 06:08:44PM +0530, Sachin Sant wrote:
quoted
Sachin Sant wrote:
quoted
Today's next tree failed to boot on a POWER 6 box with :

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2135!
Oops: Exception in kernel mode, sig: 5 [#2]
SMP NR_CPUS=1024 NUMA pSeries
Problem exists with today's next as well.

Likely cause for this problem seems to the following commit.
If i revert this patch the machine boots fine.

commit a0668cdc154e54bf0c85182e0535eea237d53146
powerpc/mm: Cleanup management of kmem_caches for pagetables
Ugh.  Ok, it's not at all obvious how my patch could cause this bug.
Can you send your .config?
Still present in today's next.
Sorry, I've been sidetracked by other issues and have only managed to
look into this today.  My initial attempts to reproduce the bug with
your config on both POWER6 and POWER5+ have failed though.

Is it possible to get the complete boot log from this system - not
just the [cut here] section around the BUG()?  This should help to
determine exactly when during boot the bug is being triggered.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: David Gibson <hidden>
Date: 2009-11-13 02:10:50

On Fri, Nov 13, 2009 at 12:37:29PM +1100, David Gibson wrote:
On Thu, Nov 12, 2009 at 04:46:40PM +0530, Sachin Sant wrote:
quoted
David Gibson wrote:
quoted
On Wed, Nov 04, 2009 at 06:08:44PM +0530, Sachin Sant wrote:
quoted
Sachin Sant wrote:
quoted
Today's next tree failed to boot on a POWER 6 box with :

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2135!
Oops: Exception in kernel mode, sig: 5 [#2]
SMP NR_CPUS=1024 NUMA pSeries
Problem exists with today's next as well.

Likely cause for this problem seems to the following commit.
If i revert this patch the machine boots fine.

commit a0668cdc154e54bf0c85182e0535eea237d53146
powerpc/mm: Cleanup management of kmem_caches for pagetables
Ugh.  Ok, it's not at all obvious how my patch could cause this bug.
Can you send your .config?
Still present in today's next.
Sorry, I've been sidetracked by other issues and have only managed to
look into this today.  My initial attempts to reproduce the bug with
your config on both POWER6 and POWER5+ have failed though.

Is it possible to get the complete boot log from this system - not
just the [cut here] section around the BUG()?  This should help to
determine exactly when during boot the bug is being triggered.
Also, could you try booting the kernel with the patch below, which
should give a bit more information about the problem.

Index: working-2.6/mm/mmap.c
===================================================================
--- working-2.6.orig/mm/mmap.c	2009-11-13 13:08:29.000000000 +1100
+++ working-2.6/mm/mmap.c	2009-11-13 13:09:26.000000000 +1100
@@ -2136,6 +2136,8 @@ void exit_mmap(struct mm_struct *mm)
 	while (vma)
 		vma = remove_vma(vma);
 
+	if (nr_ptes != 0)
+		printk("exit_mmap(): mm %p nr_ptes %d\n", mm, mm->nr_ptes);
 	BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
 }
 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: Sachin Sant <hidden>
Date: 2009-11-13 09:35:34

David Gibson wrote:
quoted hunk
so, could you try booting the kernel with the patch below, which
should give a bit more information about the problem.

Index: working-2.6/mm/mmap.c
===================================================================
--- working-2.6.orig/mm/mmap.c	2009-11-13 13:08:29.000000000 +1100
+++ working-2.6/mm/mmap.c	2009-11-13 13:09:26.000000000 +1100
@@ -2136,6 +2136,8 @@ void exit_mmap(struct mm_struct *mm)
 	while (vma)
 		vma = remove_vma(vma);

+	if (nr_ptes != 0)
+		printk("exit_mmap(): mm %p nr_ptes %d\n", mm, mm->nr_ptes);
 	BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
 }
  
Here is the information collected with today's next.
(2.6.32-rc7-20091113)

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2139!
cpu 0x3: Vector: 700 (Program Check) at [c0000000fae1b7e0]
    pc: c000000000150e88: .exit_mmap+0x1ac/0x1d4
    lr: c000000000150e78: .exit_mmap+0x19c/0x1d4
    sp: c0000000fae1ba60
   msr: 8000000000029032
  current = 0xc0000000fada8be0
  paca    = 0xc000000000bb2c00
    pid   = 84, comm = cat
kernel BUG at mm/mmap.c:2139!
enter ? for help
[c0000000fae1bb10] c000000000093d24 .mmput+0x54/0x164
[c0000000fae1bba0] c000000000098f30 .exit_mm+0x17c/0x1a0
[c0000000fae1bc50] c00000000009b310 .do_exit+0x248/0x784
[c0000000fae1bd30] c00000000009b900 .do_group_exit+0xb4/0xe8
[c0000000fae1bdc0] c00000000009b948 .SyS_exit_group+0x14/0x28
[c0000000fae1be30] c0000000000085b4 syscall_exit+0x0/0x40
--- Exception: c01 (System Call) at 00000fff89a8ff40
SP (fffdf8a2460) is in userspace

Have attached the complete boot log.

At the time of crash values of mm and mm->nr_ptes were

<7>exit_mmap(): mm c0000000fa9f9580 nr_ptes 1

Thanks
-Sachin


-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: David Gibson <hidden>
Date: 2009-11-17 05:25:42

On Fri, Nov 13, 2009 at 03:05:33PM +0530, Sachin Sant wrote:
quoted hunk
David Gibson wrote:
quoted
so, could you try booting the kernel with the patch below, which
should give a bit more information about the problem.

Index: working-2.6/mm/mmap.c
===================================================================
--- working-2.6.orig/mm/mmap.c	2009-11-13 13:08:29.000000000 +1100
+++ working-2.6/mm/mmap.c	2009-11-13 13:09:26.000000000 +1100
@@ -2136,6 +2136,8 @@ void exit_mmap(struct mm_struct *mm)
	while (vma)
		vma = remove_vma(vma);

+	if (nr_ptes != 0)
+		printk("exit_mmap(): mm %p nr_ptes %d\n", mm, mm->nr_ptes);
	BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
}
Here is the information collected with today's next.
(2.6.32-rc7-20091113)

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2139!
cpu 0x3: Vector: 700 (Program Check) at [c0000000fae1b7e0]
   pc: c000000000150e88: .exit_mmap+0x1ac/0x1d4
   lr: c000000000150e78: .exit_mmap+0x19c/0x1d4
   sp: c0000000fae1ba60
  msr: 8000000000029032
 current = 0xc0000000fada8be0
 paca    = 0xc000000000bb2c00
   pid   = 84, comm = cat
kernel BUG at mm/mmap.c:2139!
enter ? for help
[c0000000fae1bb10] c000000000093d24 .mmput+0x54/0x164
[c0000000fae1bba0] c000000000098f30 .exit_mm+0x17c/0x1a0
[c0000000fae1bc50] c00000000009b310 .do_exit+0x248/0x784
[c0000000fae1bd30] c00000000009b900 .do_group_exit+0xb4/0xe8
[c0000000fae1bdc0] c00000000009b948 .SyS_exit_group+0x14/0x28
[c0000000fae1be30] c0000000000085b4 syscall_exit+0x0/0x40
--- Exception: c01 (System Call) at 00000fff89a8ff40
SP (fffdf8a2460) is in userspace

Have attached the complete boot log.

At the time of crash values of mm and mm->nr_ptes were

<7>exit_mmap(): mm c0000000fa9f9580 nr_ptes 1
Hrm.  Ok.  I am truly baffled.  Well, below is a revised debug patch
which I hope will shed some sort of light on things.  I do also notice
from your full log that it looks like the bug is happening shortly
after we start userspace.  So it may be differences in my userspace
set up that meant I haven't been able to reproduce it.  I'll have
another look at that when I get a chance.

Index: working-2.6/mm/mmap.c
===================================================================
--- working-2.6.orig/mm/mmap.c	2009-11-17 11:55:23.000000000 +1100
+++ working-2.6/mm/mmap.c	2009-11-17 16:04:48.182600029 +1100
@@ -2136,6 +2136,9 @@ void exit_mmap(struct mm_struct *mm)
 	while (vma)
 		vma = remove_vma(vma);
 
+	if (mm->nr_ptes != 0)
+		printk("exit_mmap(): mm %p nr_ptes %d current %p pid %d comm \"%s\"\n",
+		       mm, mm->nr_ptes, current, current->pid, current->comm);
 	BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
 }
 
Index: working-2.6/mm/memory.c
===================================================================
--- working-2.6.orig/mm/memory.c	2009-11-17 11:55:23.000000000 +1100
+++ working-2.6/mm/memory.c	2009-11-17 14:57:49.881603609 +1100
@@ -156,6 +156,8 @@ static void free_pte_range(struct mmu_ga
 	pmd_clear(pmd);
 	pte_free_tlb(tlb, token, addr);
 	tlb->mm->nr_ptes--;
+	printk("free_pte_range() -> mm %p addr 0x%lx nr_ptes %d\n", tlb->mm,
+	       addr, tlb->mm->nr_ptes);
 }
 
 static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
@@ -348,6 +350,8 @@ int __pte_alloc(struct mm_struct *mm, pm
 	spin_lock(&mm->page_table_lock);
 	if (!pmd_present(*pmd)) {	/* Has another populated it ? */
 		mm->nr_ptes++;
+		printk("__pte_alloc() -> mm %p addr 0x%lx nr_ptes %d\n", mm,
+		       address, mm->nr_ptes);
 		pmd_populate(mm, pmd, new);
 		new = NULL;
 	}

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: Sachin Sant <hidden>
Date: 2009-11-17 07:37:06

David Gibson wrote:
Hrm.  Ok.  I am truly baffled.  Well, below is a revised debug patch
which I hope will shed some sort of light on things.  I do also notice
  
Thanks for the debug patch. I have attached the collected information.
from your full log that it looks like the bug is happening shortly
after we start userspace.  So it may be differences in my userspace
set up that meant I haven't been able to reproduce it.  I'll have
another look at that when I get a chance.
  
Let me know if you need access to the system on which i can recreate the
bug. I can make that system available for you to debug this issue.

Thanks
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!

From: David Gibson <hidden>
Date: 2009-11-18 03:32:28

On Tue, Nov 17, 2009 at 01:07:03PM +0530, Sachin Sant wrote:
David Gibson wrote:
quoted
Hrm.  Ok.  I am truly baffled.  Well, below is a revised debug patch
which I hope will shed some sort of light on things.  I do also notice
Thanks for the debug patch. I have attached the collected information.
quoted
from your full log that it looks like the bug is happening shortly
after we start userspace.  So it may be differences in my userspace
set up that meant I haven't been able to reproduce it.  I'll have
another look at that when I get a chance.
Let me know if you need access to the system on which i can recreate the
bug. I can make that system available for you to debug this issue.
That's probably a good idea.  I'm still pretty baffled by this, so it
will probably take several more rounds of debug patches to start
getting a handle on it.


-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help