Skip to contentSkip to conversation

kernel BUG at include/linux/mm.h:302!

k2.6.16-rc1-mm5 MIke Galbraith 3 participants 11 messages Feb 9, 2006 Memory management

lore
Share & tools
lore
#0 lore raw

Greetings,

Excuse me if this is already known, I've been too busy tinkering to read lkml.

If I compile this kernel as SMP on my P4 box, I receive this BUG on boot. Trying to start amaroK tipped me off that something was screwy, and I thought it was some scheduler changes I'm working on, but I'm innocent. The below is Virgin source.

gzipped config attached. AmaroK isn't very happy after the BUG... and neither is just about anything else it seems. Hopefully I'm not just wasting electrons typing this :) We'll see.

-Mike

kernel BUG at include/linux/mm.h:302!
invalid opcode: 0000 [#1]
PREEMPT SMP
last sysfs file: /devices/pci0000:00/0000:00:1e.0/0000:02:09.0/subsystem_device

Modules linked in: xt_pkttype ipt_LOG xt_limit snd_pcm_oss snd_mixer_oss button battery snd_seq snd_seq_device ac edd ip6t_REJECT xt_tcpudp ipt_REJECT xt_state iptable_mangle iptable_nat ip_nat iptable_filter ip6table_mangle ip_conntrack ip_tables ip6table_filter ip6_tables x_tables tda9887 at76c651 prism54 saa7134 ohci1394 ieee1394 bt878 ir_kbd_i2c snd_intel8x0 snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd soundcore snd_page_alloc i2c_i801 tuner bttv video_buf firmware_class btcx_risc ir_common tveeprom nls_iso8859_1 nls_cp437 nls_utf8 sd_mod fan thermal processor
CPU:    0
EIP:    0060:[<c01461cb>]    Not tainted VLI
EFLAGS: 00210246   (2.6.16-rc1-mm5 #1) 

EIP is at release_pages+0x165/0x196
eax: 00000000 ebx: c16f3220 ecx: 00000000 edx: 00000008
esi: c18077d0 edi: c18077b4 ebp: 00000000 esp: f6644e74
ds: 007b es: 007b ss: 0068
Process knotify (pid: 7482, threadinfo=f6644000 task=f658b030)

Stack: <0>00000008 00000008 00000001 00000000 00000000 c161e920 c161e940 c161e960 
       c161e980 c161e9a0 c057f600 f6644edc 00000001 00000002 f6644ed4 c01446de 
       c161e9a0 c18077d0 00000008 c16f32e0 c18077d0 00000008 00000008 c01521b5 
Call Trace:
 <c01446de> __pagevec_free+0x1f/0x2e   <c01521b5> free_pages_and_swap_cache+0x74/0xb6
 <c014afd4> unmap_vmas+0x5da/0x642   <c014de7d> unmap_region+0xa7/0x131
 <c014e5cd> do_munmap+0x139/0x1cc   <c014e6a0> sys_munmap+0x40/0x59
 <c0102bc3> sysenter_past_esp+0x54/0x75  
Code: e8 65 de fb ff e9 01 ff ff ff 83 ad a4 05 00 00 01 eb 85 85 ed 0f 84 c6 fe ff ff 8d 85 80 05 00 00 e8 05 64 32 00 e9 b6 fe ff ff <0f> 0b 2e 01 e6 fd 49 c0 eb b4 0f 0b 00 01 66 fe 49 c0 e9 14 ff 
 <6>note: knotify[7482] exited with preempt_count 1
BUG: scheduling while atomic: knotify/0x00000001/7482
 <c046aea3> schedule+0xaf1/0xe6e   <c011bd98> __call_console_drivers+0x38/0x44
 <c011c01f> release_console_sem+0x177/0x1e2   <c011ca3c> vprintk+0x266/0x36e
 <c011c058> release_console_sem+0x1b0/0x1e2   <c046bf21> rwsem_down_read_failed+0x92/0x200
 <c011f923> .text.lock.exit+0x7/0x64   <c011e498> do_exit+0x115/0x8d9
 <c0104362> do_simd_coprocessor_error+0x0/0x163   <c010477d> do_invalid_op+0x0/0xab
 <c010481f> do_invalid_op+0xa2/0xab   <c01461cb> release_pages+0x165/0x196
 <c0114715> __wake_up+0x32/0x43   <c03b0168> sock_def_readable+0x3c/0x69
 <c01037bb> error_code+0x4f/0x54   <c01461cb> release_pages+0x165/0x196
 <c01446de> __pagevec_free+0x1f/0x2e   <c01521b5> free_pages_and_swap_cache+0x74/0xb6
 <c014afd4> unmap_vmas+0x5da/0x642   <c014de7d> unmap_region+0xa7/0x131
 <c014e5cd> do_munmap+0x139/0x1cc   <c014e6a0> sys_munmap+0x40/0x59
 <c0102bc3> sysenter_past_esp+0x54/0x75  

SysRq-T

amarokapp X C0132967 0 7898 1 7929 7767 (L-TLB)
e563ce6c 00000001 00000000 c0132967 7fffffff 00000000 f16b1b9a 000000e1

       00000202 e563c000 f6531ab0 f669c580 dff0b740 00000a07 f664b164 f664b030 
       e458e030 c18084c0 f174a51c 000000e1 00000000 e563c000 00000000 e458e030 
Call Trace:
 <c0132967> sys_futex+0x50/0x108   <c011d870> exit_mm+0x10c/0x129
 <c011e894> do_exit+0x511/0x8d9   <c011ec85> do_group_exit+0x29/0x86
 <c0127d65> get_signal_to_deliver+0x271/0x4a9   <c0102508> do_notify_resume+0x87/0x673
 <c0418823> unix_ioctl+0x98/0xb8   <c03ac335> sock_ioctl+0xb4/0x1ec
 <c01704b6> sys_select+0xd2/0x1ac   <c0102cae> work_notifysig+0x13/0x19
amarokapp     D 00000001     0  7929      1  7927    7804  7898 (L-TLB)
e4156bf8 00000002 e4156be4 00000001 00001ef9 00000000 f1c78b0c 000000e1 
       00000000 e4156000 00000000 e4156d30 1e2c31bc 0003a1bf e458e6a4 e458e570 
       c0579000 c18084c0 f1cddb08 000000e1 00000000 e4156000 e458e570 f1c78b0c 
Call Trace:
 <c011ec11> do_exit+0x88e/0x8d9   <c01036f0> apic_timer_interrupt+0x1c/0x24
 <c0104362> do_simd_coprocessor_error+0x0/0x163   <c010477d> do_invalid_op+0x0/0xab
 <c010481f> do_invalid_op+0xa2/0xab   <c01461cb> release_pages+0x165/0x196
 <c0143a3d> free_pages_bulk+0x2f/0x2f5   <c01037bb> error_code+0x4f/0x54
 <c014007b> generic_file_buffered_write+0x3e2/0x670   <c01461cb> release_pages+0x165/0x196
 <c01521b5> free_pages_and_swap_cache+0x74/0xb6   <c014afd4> unmap_vmas+0x5da/0x642
 <c014d750> exit_mmap+0x82/0x114   <c01198f3> mmput+0x31/0xef
 <c011e498> do_exit+0x115/0x8d9   <c011ec85> do_group_exit+0x29/0x86
 <c0127d65> get_signal_to_deliver+0x271/0x4a9   <c0102508> do_notify_resume+0x87/0x673
 <c0116cbc> default_wake_function+0x0/0xc   <c0132967> sys_futex+0x50/0x108
 <c0102cae> work_notifysig+0x13/0x19  
amarokapp     X 00000000     0  7927   7929          7928       (L-TLB)
e4fa9e6c 00000000 0000000f 00000000 00000001 e53edaa8 f198dea3 000000e1 
       f38d0480 e4fa9000 e458e570 00000000 f67d7580 00016bd0 e4df6164 e4df6030 
       dffb4ab0 c18104c0 f1a636e9 000000e1 00000001 e4fa9000 00000000 dffb4ab0 
Call Trace:
 <c011e894> do_exit+0x511/0x8d9   <c046a708> schedule+0x356/0xe6e
 <c046a733> schedule+0x381/0xe6e   <c011ec85> do_group_exit+0x29/0x86
 <c0127d65> get_signal_to_deliver+0x271/0x4a9   <c0102508> do_notify_resume+0x87/0x673
 <c016926c> pipe_wait+0x85/0x8c   <c012e9c4> autoremove_wake_function+0x0/0x37
 <c0169ce7> pipe_read+0x0/0x29   <c0169d07> pipe_read+0x20/0x29
 <c015d7dd> vfs_read+0xa2/0x158   <c015e280> sys_read+0x41/0x6a
 <c0102cae> work_notifysig+0x13/0x19  
amarokapp     X 00000000     0  7928   7929                7927 (L-TLB)
e458fe6c 00000000 0000000f 00000000 00000001 e53ed92c f189a1fc 000000e1 
       f627bd80 e458f000 f6531030 dffe3580 dff0b900 00001ccc e458ebe4 e458eab0 
       e4df6030 c18104c0 f18c9ee2 000000e1 00000001 e458f000 00000000 e4df6030 
Call Trace:
 <c011e894> do_exit+0x511/0x8d9   <c046a97d> schedule+0x5cb/0xe6e
 <c011ec85> do_group_exit+0x29/0x86   <c0127d65> get_signal_to_deliver+0x271/0x4a9
 <c0102508> do_notify_resume+0x87/0x673   <c016926c> pipe_wait+0x85/0x8c
 <c012e9c4> autoremove_wake_function+0x0/0x37   <c0169ce7> pipe_read+0x0/0x29
 <c0169d07> pipe_read+0x20/0x29   <c015d7dd> vfs_read+0xa2/0x158
 <c015e280> sys_read+0x41/0x6a   <c0102cae> work_notifysig+0x13/0x19
#1 lore raw
Quoted 5 lines · MIke Galbraith

Greetings,

Excuse me if this is already known, I've been too busy tinkering to read lkml.

It should be fixed as of current -git (not sure about the latest -mm though). It would be good if you could verify that 2.6.16-rc2-git7 works OK for you.

Thanks,
Nick

Signature · 2 lines
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 
#9 lore raw
In reply to MIke Galbraith
Quoted 16 lines · MIke Galbraith

If I compile this kernel as SMP on my P4 box, I receive this BUG on
boot. Trying to start amaroK tipped me off that something was screwy, and I thought it was some scheduler changes I'm working on, but I'm innocent. The below is Virgin source.

gzipped config attached. AmaroK isn't very happy after the BUG... and neither is just about anything else it seems. Hopefully I'm not just wasting electrons typing this :) We'll see.

-Mike

kernel BUG at include/linux/mm.h:302!
invalid opcode: 0000 [#1]
PREEMPT SMP
last sysfs file: /devices/pci0000:00/0000:00:1e.0/0000:02:09.0/subsystem_device

Quoted 16 lines
 Modules linked in: xt_pkttype ipt_LOG xt_limit snd_pcm_oss snd_mixer_oss button battery snd_seq snd_seq_device ac edd ip6t_REJECT xt_tcpudp ipt_REJECT xt_state iptable_mangle iptable_nat ip_nat iptable_filter ip6table_mangle ip_conntrack ip_tables ip6table_filter ip6_tables x_tables tda9887 at76c651 prism54 saa7134 ohci1394 ieee1394 bt878 ir_kbd_i2c snd_intel8x0 snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd soundcore snd_page_alloc i2c_i801 tuner bttv video_buf firmware_class btcx_risc ir_common tveeprom nls_iso8859_1 nls_cp437 nls_utf8 sd_mod fan thermal processor
 CPU:    0
 EIP:    0060:[<c01461cb>]    Not tainted VLI
 EFLAGS: 00210246   (2.6.16-rc1-mm5 #1) 
 EIP is at release_pages+0x165/0x196
 eax: 00000000   ebx: c16f3220   ecx: 00000000   edx: 00000008
 esi: c18077d0   edi: c18077b4   ebp: 00000000   esp: f6644e74
 ds: 007b   es: 007b   ss: 0068
 Process knotify (pid: 7482, threadinfo=f6644000 task=f658b030)
 Stack: <0>00000008 00000008 00000001 00000000 00000000 c161e920 c161e940 c161e960 
        c161e980 c161e9a0 c057f600 f6644edc 00000001 00000002 f6644ed4 c01446de 
        c161e9a0 c18077d0 00000008 c16f32e0 c18077d0 00000008 00000008 c01521b5 
 Call Trace:
  <c01446de> __pagevec_free+0x1f/0x2e   <c01521b5> free_pages_and_swap_cache+0x74/0xb6
  <c014afd4> unmap_vmas+0x5da/0x642   <c014de7d> unmap_region+0xa7/0x131
  <c014e5cd> do_munmap+0x139/0x1cc   <c014e6a0> sys_munmap+0x40/0x59

Doesn't happen here (but it never does).

Is it always knotify, always dying in the same manner?

#2 lore raw
In reply to Nick Piggin
Quoted 4 lines · Nick Piggin
Quoted 2 lines · MIke Galbraith

Greetings,

Quoted 8 lines
Quoted 3 lines

Excuse me if this is already known, I've been too busy tinkering to read lkml.

It should be fixed as of current -git (not sure about the latest -mm though). It would be good if you could verify that 2.6.16-rc2-git7 works OK for you.

This was a -mm kernel - how do we know it's not -mm breakage?

IOW: to what bug are you referring?

#8 lore raw
In reply to Nick Piggin
Quoted 10 lines · Nick Piggin
Quoted 5 lines · MIke Galbraith

Greetings,

Excuse me if this is already known, I've been too busy tinkering to read lkml.

It should be fixed as of current -git (not sure about the latest -mm though). It would be good if you could verify that 2.6.16-rc2-git7 works OK for you.

Well shoot. I'd be happy to if I could find it. That extension makes me suspect I need to gitified to get there from here. Yes? I'm more accustomed to digging bits and pieces out of mondo patches... no SCM thingies here.

-Mike (SCM wimp)

#10 lore raw
In reply to Andrew Morton
Quoted 24 lines · Andrew Morton
Quoted 6 lines · MIke Galbraith

kernel BUG at include/linux/mm.h:302!
invalid opcode: 0000 [#1]
PREEMPT SMP
last sysfs file: /devices/pci0000:00/0000:00:1e.0/0000:02:09.0/subsystem_device

Quoted 16 lines
 Modules linked in: xt_pkttype ipt_LOG xt_limit snd_pcm_oss snd_mixer_oss button battery snd_seq snd_seq_device ac edd ip6t_REJECT xt_tcpudp ipt_REJECT xt_state iptable_mangle iptable_nat ip_nat iptable_filter ip6table_mangle ip_conntrack ip_tables ip6table_filter ip6_tables x_tables tda9887 at76c651 prism54 saa7134 ohci1394 ieee1394 bt878 ir_kbd_i2c snd_intel8x0 snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd soundcore snd_page_alloc i2c_i801 tuner bttv video_buf firmware_class btcx_risc ir_common tveeprom nls_iso8859_1 nls_cp437 nls_utf8 sd_mod fan thermal processor
 CPU:    0
 EIP:    0060:[<c01461cb>]    Not tainted VLI
 EFLAGS: 00210246   (2.6.16-rc1-mm5 #1) 
 EIP is at release_pages+0x165/0x196
 eax: 00000000   ebx: c16f3220   ecx: 00000000   edx: 00000008
 esi: c18077d0   edi: c18077b4   ebp: 00000000   esp: f6644e74
 ds: 007b   es: 007b   ss: 0068
 Process knotify (pid: 7482, threadinfo=f6644000 task=f658b030)
 Stack: <0>00000008 00000008 00000001 00000000 00000000 c161e920 c161e940 c161e960 
        c161e980 c161e9a0 c057f600 f6644edc 00000001 00000002 f6644ed4 c01446de 
        c161e9a0 c18077d0 00000008 c16f32e0 c18077d0 00000008 00000008 c01521b5 
 Call Trace:
  <c01446de> __pagevec_free+0x1f/0x2e   <c01521b5> free_pages_and_swap_cache+0x74/0xb6
  <c014afd4> unmap_vmas+0x5da/0x642   <c014de7d> unmap_region+0xa7/0x131
  <c014e5cd> do_munmap+0x139/0x1cc   <c014e6a0> sys_munmap+0x40/0x59
Quoted 4 lines

Doesn't happen here (but it never does).

Is it always knotify, always dying in the same manner?

Yes, tentatively. I haven't rebooted many times, but every time I have, It's been knotify.

-Mike

#3 lore raw
In reply to Andrew Morton
Quoted 9 lines · Andrew Morton
Quoted 8 lines · Nick Piggin
Quoted 5 lines · MIke Galbraith

Greetings,

Excuse me if this is already known, I've been too busy tinkering to read lkml.

Quoted 6 lines
Quoted 4 lines

It should be fixed as of current -git (not sure about the latest -mm though). It would be good if you could verify that 2.6.16-rc2-git7 works OK for you.

This was a -mm kernel - how do we know it's not -mm breakage?

It _appears_ to be mm breakage. I just built/ran rc1 with the same config, and it works fine.

RL is calling, so I can't dig right this minute... in a couple hours I hope to be able to start though.

Before I get to the 'what comes next' compile marathon, any likely candidates? (or Nick, do you have the supposed fix handy?)

-Mike

#4 lore raw
Quoted 18 lines · MIke Galbraith
Quoted 9 lines · Andrew Morton
Quoted 8 lines · Nick Piggin
Quoted 5 lines · MIke Galbraith

Greetings,

Excuse me if this is already known, I've been too busy tinkering to read lkml.

Quoted 6 lines
Quoted 4 lines

It should be fixed as of current -git (not sure about the latest -mm though). It would be good if you could verify that 2.6.16-rc2-git7 works OK for you.

This was a -mm kernel - how do we know it's not -mm breakage?

Quoted 8 lines

It _appears_ to be mm breakage. I just built/ran rc1 with the same config, and it works fine.

RL is calling, so I can't dig right this minute... in a couple hours I hope to be able to start though.

Before I get to the 'what comes next' compile marathon, any likely candidates?

rc2-mm1?

Quoted 1 line

(or Nick, do you have the supposed fix handy?)

Yeah, I'm still scratching my head over the mystery fix.

#5 lore raw
Quoted 6 lines · Andrew Morton
Quoted 4 lines · MIke Galbraith
Quoted 1 line · Andrew Morton

This was a -mm kernel - how do we know it's not -mm breakage?

It's an educated guess. I suppose it could be -mm breakage.

I sent Andrew a patch which tightens up some debug checking, and that is likely to be causing your BUGs.

Quoted 10 lines
Quoted 8 lines

It _appears_ to be mm breakage. I just built/ran rc1 with the same config, and it works fine.

RL is calling, so I can't dig right this minute... in a couple hours I hope to be able to start though.

Before I get to the 'what comes next' compile marathon, any likely candidates?

Quoted 9 lines

rc2-mm1?

Quoted 1 line

(or Nick, do you have the supposed fix handy?)

Yeah, I'm still scratching my head over the mystery fix.

The mm/swap.c hunk from git 8519fb30e438f8088b71a94a7d5a660a814d3872 is the mystery fix (the mm.h hunk is already in there).

I suppose you'd better verify that -mm works fine with the patch as well, when you get time.

Thanks,

Signature · 3 lines
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com 
#6 lore raw
Quoted 9 lines · Nick Piggin
Quoted 6 lines · Andrew Morton
Quoted 1 line

(or Nick, do you have the supposed fix handy?)

Yeah, I'm still scratching my head over the mystery fix.

Quoted 5 lines

The mm/swap.c hunk from git 8519fb30e438f8088b71a94a7d5a660a814d3872 is the mystery fix (the mm.h hunk is already in there).

I suppose you'd better verify that -mm works fine with the patch as well, when you get time.

Verified. rc2-mm1 worked fine, and plugging the extracted bit below into rc1-mm5 fixed it's BUG.

Thanks,

-Mike

mm/swap.c +23 -11
@@ -34,19 +34,22 @@
 /* How many pages do we try to swap or page in/out together? */
 int page_cluster;
 
-void put_page(struct page *page)
+static void put_compound_page(struct page *page)
 {
-	if (unlikely(PageCompound(page))) {
-		page = (struct page *)page_private(page);
-		if (put_page_testzero(page)) {
-			void (*dtor)(struct page *page);
+	page = (struct page *)page_private(page);
+	if (put_page_testzero(page)) {
+		void (*dtor)(struct page *page);
 
-			dtor = (void (*)(struct page *))page[1].mapping;
-			(*dtor)(page);
-		}
-		return;
+		dtor = (void (*)(struct page *))page[1].mapping;
+		(*dtor)(page);
 	}
-	if (put_page_testzero(page))
+}
+
+void put_page(struct page *page)
+{
+	if (unlikely(PageCompound(page)))
+		put_compound_page(page);
+	else if (put_page_testzero(page))
 		__page_cache_release(page);
 }
 EXPORT_SYMBOL(put_page);
@@ -242,6 +245,15 @@
 	for (i = 0; i < nr; i++) {
 		struct page *page = pages[i];
 
+		if (unlikely(PageCompound(page))) {
+			if (zone) {
+				spin_unlock_irq(&zone->lru_lock);
+				zone = NULL;
+			}
+			put_compound_page(page);
+			continue;
+		}
+
 		if (!put_page_testzero(page))
 			continue;
 
@@ -265,7 +277,7 @@
 			}
 			__pagevec_free(&pages_to_free);
 			pagevec_reinit(&pages_to_free);
-		}
+  		}
 	}
 	if (zone)
 		spin_unlock_irq(&zone->lru_lock);
#7 lore raw
Quoted 15 lines · MIke Galbraith
Quoted 13 lines · Nick Piggin
Quoted 6 lines · Andrew Morton
Quoted 1 line

(or Nick, do you have the supposed fix handy?)

Yeah, I'm still scratching my head over the mystery fix.

The mm/swap.c hunk from git 8519fb30e438f8088b71a94a7d5a660a814d3872 is the mystery fix (the mm.h hunk is already in there).

Quoted 7 lines
Quoted 2 lines

I suppose you'd better verify that -mm works fine with the patch as well, when you get time.

Verified. rc2-mm1 worked fine, and plugging the extracted bit below into rc1-mm5 fixed it's BUG.

Thanks. And thanks for reporting.

Signature · 2 lines
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com