Oops on 2.5.1-pre6 doing mkreiserfs on loop device
The three commands below are what executed just before the Oops. Output to console and ps show that mkreiserfs command was executing. The commands are a portion of a script I've run without Oops on other kernels.
dd if=/dev/zero of=root_fs seek=100 count=1 bs=1M
losetup /dev/loop0 /usr/src/uml/linux/root_fs
yes | mkreiserfs /dev/loop0
The ksymoops output below is with the default options. /usr/src/linux was the 2.5.1-pre6 tree.
First oops:
Unable to handle kernel paging request at virtual address 61616179 c012b422 *pde = 00000000 Oops: 0000 CPU: 0 EIP: 0010:[<c012b422>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010246
eax: 61616161 ebx: 61616161 ecx: 61616161 edx: 00000000
esi: 00000000 edi: f32a0000 ebp: 00000001 esp: cfab5fa0
ds: 0018 es: 0018 ss: 0018
Process loop0 (pid: 11340, stackpage=cfab5000)
Stack: c012e582 cfab4000 c6477fc0 e0a5e000 00000001 0000000c 00000286 f1c52d40 c01344d3 c6477fc0 00000008 fac2ec19 c6477fc0 00000001 00000008 e0a5e000 c6477fc0 00000f00 f7637f2c e0a5e000 c01054e8 e0a5e000 00000078 f74ec0c0 Call Trace: [<c012e582>] [<c01344d3>] [<fac2ec19>] [<c01054e8>] Code: 8b 41 18 f6 c4 40 75 11 ff 49 14 0f 94 c0 84 c0 74 07 89 c8
Quoted 1 line
Quoted 1 line
EIP;
c012b422<__free_pages+2/20> <=====
Trace; c012e582 <bounce_end_io_read+132/170>
Trace; c01344d2 <bio_endio+22/30>
Trace; fac2ec18 <[loop]loop_thread+c8/150>
Trace; c01054e8 <kernel_thread+28/40>
Code; c012b422 <__free_pages+2/20>
00000000 <_EIP>:
Code; c012b422 <__free_pages+2/20> <=====
0: 8b 41 18 mov 0x18(%ecx),%eax <=====
Code; c012b424 <__free_pages+4/20>
3: f6 c4 40 test $0x40,%ah
Code; c012b428 <__free_pages+8/20>
6: 75 11 jne 19 <_EIP+0x19> c012b43a <__free_pages+1a/20>
Code; c012b42a <__free_pages+a/20>
8: ff 49 14 decl 0x14(%ecx)
Code; c012b42c <__free_pages+c/20>
b: 0f 94 c0 sete %al
Code; c012b430 <__free_pages+10/20>
e: 84 c0 test %al,%al
Code; c012b432 <__free_pages+12/20>
10: 74 07 je 19 <_EIP+0x19> c012b43a <__free_pages+1a/20>
Code; c012b434 <__free_pages+14/20>
12: 89 c8 mov %ecx,%eax
2nd oops after fresh boot running the same script.
Unable to handle kernel NULL pointer dereference at virtual address 00000018 c012b422 *pde = 00000000 Oops: 0000 CPU: 0 EIP: 0010:[<c012b422>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010246
eax: 00000000 ebx: 00000000 ecx: 00000000 edx: 00000000
esi: 00000000 edi: f398a000 ebp: 00000001 esp: f3995fa0
ds: 0018 es: 0018 ss: 0018
Process loop0 (pid: 123, stackpage=f3995000)
Stack: c012e582 f3994000 f7eaf4c0 f3c43000 00000001 0000000c 00000286 f7eb0d00 c01344d3 f7eaf4c0 00000008 fac2ec19 f7eaf4c0 00000001 00000008 f3c43000 f7eaf4c0 00000f00 f39a7f2c f3c43000 c01054e8 f3c43000 00000078 f3a55cc0 Call Trace: [<c012e582>] [<c01344d3>] [<fac2ec19>] [<c01054e8>] Code: 8b 41 18 f6 c4 40 75 11 ff 49 14 0f 94 c0 84 c0 74 07 89 c8
Quoted 1 line
Quoted 1 line
EIP;
c012b422<__free_pages+2/20> <=====
Trace; c012e582 <bounce_end_io_read+132/170>
Trace; c01344d2 <bio_endio+22/30>
Trace; fac2ec18 <[loop]loop_thread+c8/150>
Trace; c01054e8 <kernel_thread+28/40>
Code; c012b422 <__free_pages+2/20>
00000000 <_EIP>:
Code; c012b422 <__free_pages+2/20> <=====
0: 8b 41 18 mov 0x18(%ecx),%eax <=====
Code; c012b424 <__free_pages+4/20>
3: f6 c4 40 test $0x40,%ah
Code; c012b428 <__free_pages+8/20>
6: 75 11 jne 19 <_EIP+0x19> c012b43a <__free_pages+1a/20>
Code; c012b42a <__free_pages+a/20>
8: ff 49 14 decl 0x14(%ecx)
Code; c012b42c <__free_pages+c/20>
b: 0f 94 c0 sete %al
Code; c012b430 <__free_pages+10/20>
e: 84 c0 test %al,%al
Code; c012b432 <__free_pages+12/20>
10: 74 07 je 19 <_EIP+0x19> c012b43a <__free_pages+1a/20>
Code; c012b434 <__free_pages+14/20>
12: 89 c8 mov %ecx,%eax
Linux rushmore 2.5.1-pre6 #1 Thu Dec 6 20:18:20 EST 2001 i686 unknown
Gnu C 2.95.3 Gnu make 3.79.1 binutils 2.11.2 util-linux 2.11m mount 2.11m modutils 2.4.12 e2fsprogs 1.25 reiserfsprogs 3.x.0j PPP 2.4.1 Linux C Library 2.2.4 Dynamic linker (ldd) 2.2.4 Procps 2.0.7 Net-tools 1.60 Kbd 1.06 Sh-utils 2.0 Modules Loaded loop
Hardware:
Athlon 1333
1024 MB RAM
IDE disk
00:00.0 Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 03) 00:01.0 PCI bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133 AGP] 00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40) 00:07.1 IDE interface: VIA Technologies, Inc. Bus Master IDE (rev 06) 00:07.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40) 00:0d.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139 (rev 10) 00:0f.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10) 01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 04)
I've run these commands several times on 2.4.17-pre2.
diff 2.5.1-pre6 2.4.17-pre2
Quoted 4 lines
CONFIG_NETLINK=yCONFIG_RTNETLINK=yCONFIG_IP_NF_QUEUE=mCONFIG_ETHERTAP=m
CONFIG_X86=yCONFIG_ISA=yCONFIG_UID16=yCONFIG_EXPERIMENTAL=yCONFIG_MODULES=yCONFIG_KMOD=yCONFIG_MK7=yCONFIG_X86_WP_WORKS_OK=yCONFIG_X86_INVLPG=yCONFIG_X86_CMPXCHG=yCONFIG_X86_XADD=yCONFIG_X86_BSWAP=yCONFIG_X86_POPAD_OK=yCONFIG_RWSEM_XCHGADD_ALGORITHM=yCONFIG_X86_L1_CACHE_SHIFT=6CONFIG_X86_TSC=yCONFIG_X86_GOOD_APIC=yCONFIG_X86_USE_3DNOW=yCONFIG_X86_PGE=yCONFIG_X86_USE_PPRO_CHECKSUM=yCONFIG_HIGHMEM4G=yCONFIG_HIGHMEM=yCONFIG_MTRR=yCONFIG_X86_UP_APIC=yCONFIG_X86_UP_IOAPIC=yCONFIG_X86_LOCAL_APIC=yCONFIG_X86_IO_APIC=yCONFIG_NET=yCONFIG_PCI=yCONFIG_PCI_GOANY=yCONFIG_PCI_BIOS=yCONFIG_PCI_DIRECT=yCONFIG_PCI_NAMES=yCONFIG_SYSVIPC=yCONFIG_SYSCTL=yCONFIG_KCORE_ELF=yCONFIG_BINFMT_ELF=yCONFIG_PM=yCONFIG_APM=mCONFIG_APM_IGNORE_USER_SUSPEND=yCONFIG_APM_RTC_IS_GMT=yCONFIG_PNP=yCONFIG_BLK_DEV_FD=yCONFIG_BLK_DEV_LOOP=mCONFIG_PACKET=yCONFIG_PACKET_MMAP=yCONFIG_NETFILTER=yCONFIG_UNIX=yCONFIG_INET=yCONFIG_IP_MULTICAST=yCONFIG_IP_NF_CONNTRACK=yCONFIG_IP_NF_FTP=mCONFIG_IP_NF_IPTABLES=yCONFIG_IP_NF_MATCH_LIMIT=yCONFIG_IP_NF_MATCH_MULTIPORT=yCONFIG_IP_NF_MATCH_STATE=yCONFIG_IP_NF_FILTER=yCONFIG_IP_NF_NAT=yCONFIG_IP_NF_NAT_NEEDED=yCONFIG_IP_NF_TARGET_MASQUERADE=yCONFIG_IP_NF_NAT_FTP=mCONFIG_IDE=yCONFIG_BLK_DEV_IDE=yCONFIG_BLK_DEV_IDEDISK=yCONFIG_IDEDISK_MULTI_MODE=yCONFIG_BLK_DEV_IDECD=mCONFIG_BLK_DEV_IDEPCI=yCONFIG_BLK_DEV_IDEDMA_PCI=yCONFIG_BLK_DEV_ADMA=yCONFIG_IDEDMA_PCI_AUTO=yCONFIG_BLK_DEV_IDEDMA=yCONFIG_BLK_DEV_VIA82CXXX=yCONFIG_IDEDMA_AUTO=yCONFIG_BLK_DEV_IDE_MODES=yCONFIG_NETDEVICES=yCONFIG_TUN=mCONFIG_NET_ETHERNET=yCONFIG_NET_ISA=yCONFIG_NET_PCI=yCONFIG_8139TOO=yCONFIG_PPP=yCONFIG_PPP_ASYNC=yCONFIG_PPP_DEFLATE=yCONFIG_PPP_BSDCOMP=yCONFIG_VT=yCONFIG_VT_CONSOLE=yCONFIG_SERIAL=yCONFIG_UNIX98_PTYS=yCONFIG_UNIX98_PTY_COUNT=128CONFIG_MOUSE=yCONFIG_PSMOUSE=yCONFIG_RTC=mCONFIG_REISERFS_FS=yCONFIG_FAT_FS=mCONFIG_MSDOS_FS=mCONFIG_VFAT_FS=mCONFIG_ISO9660_FS=mCONFIG_PROC_FS=yCONFIG_DEVPTS_FS=yCONFIG_MSDOS_PARTITION=yCONFIG_NLS=yCONFIG_NLS_DEFAULT="iso8859-1"CONFIG_NLS_CODEPAGE_437=mCONFIG_VGA_CONSOLE=yCONFIG_VIDEO_SELECT=yCONFIG_FB=yCONFIG_DUMMY_CONSOLE=yCONFIG_VIDEO_SELECT=yCONFIG_FB_MATROX=yCONFIG_FB_MATROX_G100=yCONFIG_FBCON_ADVANCED=yCONFIG_FBCON_MFB=yCONFIG_FBCON_CFB2=yCONFIG_FBCON_CFB4=yCONFIG_FBCON_CFB8=yCONFIG_FBCON_CFB16=yCONFIG_FBCON_CFB24=yCONFIG_FBCON_CFB32=yCONFIG_FBCON_FONTS=y
CONFIG_FONT_8x16=yCONFIG_SOUND=yCONFIG_SOUND_CMPCI=yCONFIG_SOUND_CMPCI_CM8738=yCONFIG_SOUND_CMPCI_SPEAKERS=2CONFIG_DEBUG_KERNEL=yCONFIG_MAGIC_SYSRQ=y
Hope this helps.
Sorry if the mail saying Jen's patch fixing 2.5.1-pre3 on highmem was incorrectly addressed. I applied Jen's patch to 2.5.1-pre3 before pre4 came out and verified the fix.
Signature · 1 line
Randy Hron
Quoted 5 lines · On Thu, Dec 06 2001, [email protected] wrote:
The three commands below are what executed just before the Oops. Output to console and ps show that mkreiserfs command was executing. The commands are a portion of a script I've run without Oops on other kernels.
This should fix it.
highmem.c renamed from opt/kernel/linux-2.5.1-pre6/mm/highmem.c +24 -17
@@ -225,12 +225,11 @@ vfrom =page_address (fromvec->bv_page) + fromvec->bv_offset; -__save_flags (flags); -__cli (); +local_irq_save (flags); vto =kmap_atomic (tovec->bv_page,KM_BOUNCE_READ ); -memcpy (vto + tovec->bv_offset, vfrom, to->bi_size); +memcpy (vto + tovec->bv_offset, vfrom, tovec->bv_len);kunmap_atomic (vto,KM_BOUNCE_READ ); -__restore_flags (flags); +local_irq_restore (flags); } }
@@ -263,28 +262,36 @@static inline int bounce_end_io (struct bio *bio,int nr_sectors) {struct bio *bio_orig = bio->bi_private; -struct page *page =bio_page (bio); +struct bio_vec *bvec, *org_vec;unsigned long flags; -int ret; +int ret, i;if (test_bit (BIO_UPTODATE , &bio->bi_flags))set_bit (BIO_UPTODATE , &bio_orig->bi_flags); ret = bio_orig->bi_end_io (bio_orig, nr_sectors); +/* +* free up bounce indirect pages used +*/ spin_lock_irqsave (&emergency_lock, flags); -if (nr_emergency_pages >=POOL_SIZE ) { -spin_unlock_irqrestore (&emergency_lock, flags); -__free_page (page); - }else { -/* -* We are abusing page->list to manage -* the highmem emergency pool: -*/ -list_add (&page->list, &emergency_pages); - nr_emergency_pages++; -spin_unlock_irqrestore (&emergency_lock, flags); +bio_for_each_segment (bvec, bio, i) { + org_vec = &bio_orig->bi_io_vec[0 ]; +if (bvec->bv_page == org_vec->bv_page) +continue ; + +if (nr_emergency_pages >=POOL_SIZE ) +__free_page (bvec->bv_page); +else { +/* +* We are abusing page->list to manage +* the highmem emergency pool: +*/ +list_add (&bvec->bv_page->list, &emergency_pages); + nr_emergency_pages++; + } } +spin_unlock_irqrestore (&emergency_lock, flags);bio_put (bio);return ret;
Signature · 1 line
Jens Axboe
Review
Quoted 2 lines · Jens Axboe
(quoted diff) +2
-0+ bio_for_each_segment(bvec, bio, i) { + org_vec = &bio_orig->bi_io_vec[0];
^
argh, that should read 'i' and not '0' of course.
Signature · 1 line
Jens Axboe
Quoted 6 lines · Jens Axboe
Review
Quoted 2 lines · Jens Axboe
(quoted diff) +2
-0+ bio_for_each_segment(bvec, bio, i) { + org_vec = &bio_orig->bi_io_vec[0];^argh, that should read 'i' and not '0' of course.
Updated patch follows.
linux/bio.h renamed from opt/kernel/linux-2.5.1-pre6/include/linux/bio.h +9 -3
@@ -100,7 +100,6 @@#define bio_iovec_idx (bio, idx) (&((bio)->bi_io_vec[(idx)]))#define bio_iovec (bio) bio_iovec_idx((bio), (bio)->bi_idx)#define bio_page (bio) bio_iovec((bio))->bv_page -#define __bio_offset (bio, idx) bio_iovec_idx((bio), (idx))->bv_offset#define bio_offset (bio) bio_iovec((bio))->bv_offset#define bio_sectors (bio) ((bio)->bi_size >> 9)#define bio_data (bio) (page_address(bio_page((bio))) + bio_offset((bio)))
@@ -136,10 +135,17 @@#define bio_io_error (bio) bio_endio((bio), 0, bio_sectors((bio))) -#define bio_for_each_segment (bvl, bio, i) \ - for (bvl = bio_iovec((bio)), i = (bio)->bi_idx; \ +/* +* drivers should not use the __ version unless they _really_ want to +* run through the entire bio and not just pending pieces +*/ +#define __bio_for_each_segment (bvl, bio, i, start_idx) \ + for (bvl = bio_iovec((bio)), i = (start_idx); \ i < (bio)->bi_vcnt; \ bvl++, i++) + +#define bio_for_each_segment (bvl, bio, i) \ + __bio_for_each_segment(bvl, bio, i, (bio)->bi_idx)/* * get a reference to a bio, so it won't disappear. the intended use is
highmem.c renamed from opt/kernel/linux-2.5.1-pre6/mm/highmem.c +24 -17
64 lines not on this page · raw message
Signature · 1 line
Jens Axboe
Quoted 3 lines · Jens Axboe
Quoted 1 line
argh, that should read 'i' and not '0' of course.
Updated patch follows.
I got a very similar oops during mkreiserfs /dev/loop0 on this HIGHMEM machine.
Unable to handle kernel NULL pointer dereference at virtual address 00000018 c012b422 *pde = 00000000 Oops: 0000 CPU: 0 EIP: 0010:[<c012b422>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010046
eax: 00000000 ebx: f7e7241c ecx: 00000000 edx: 00000000
esi: 00000000 edi: 00000000 ebp: f7eaf280 esp: f7631f98
ds: 0018 es: 0018 ss: 0018
Process loop0 (pid: 131, stackpage=f7631000)
Stack: c012e5e5 f7630000 f7eaf2c0 f7651000 00000001 0000000c 00000286 00000000 00000286 f7eaf280 c0134553 f7eaf2c0 00000008 fac2ec19 f7eaf2c0 00000001 00000008 f7651000 f7eaf2c0 00000f00 f764ff2c f7651000 c01054e8 f7651000 Call Trace: [<c012e5e5>] [<c0134553>] [<fac2ec19>] [<c01054e8>] Code: 8b 41 18 f6 c4 40 75 11 ff 49 14 0f 94 c0 84 c0 74 07 89 c8
Quoted 1 line
Quoted 1 line
EIP;
c012b422<__free_pages+2/20> <=====
Trace; c012e5e4 <bounce_end_io_read+144/1a0>
Trace; c0134552 <bio_endio+22/30>
Trace; fac2ec18 <[loop]loop_thread+c8/150>
Trace; c01054e8 <kernel_thread+28/40>
Code; c012b422 <__free_pages+2/20>
00000000 <_EIP>:
Code; c012b422 <__free_pages+2/20> <=====
0: 8b 41 18 mov 0x18(%ecx),%eax <=====
Code; c012b424 <__free_pages+4/20>
3: f6 c4 40 test $0x40,%ah
Code; c012b428 <__free_pages+8/20>
6: 75 11 jne 19 <_EIP+0x19> c012b43a <__free_pages+1a/20>
Code; c012b42a <__free_pages+a/20>
8: ff 49 14 decl 0x14(%ecx)
Code; c012b42c <__free_pages+c/20>
b: 0f 94 c0 sete %al
Code; c012b430 <__free_pages+10/20>
e: 84 c0 test %al,%al
Code; c012b432 <__free_pages+12/20>
10: 74 07 je 19 <_EIP+0x19> c012b43a <__free_pages+1a/20>
Code; c012b434 <__free_pages+14/20>
12: 89 c8 mov %ecx,%eax
I eyeballed the patched source to verify it applied. I noticed some of the lines in the patch have a \ at the end of line. That may be irrelevant.
Review
Quoted 2 lines
(quoted diff) +2
-0+#define __bio_for_each_segment(bvl, bio, i, start_idx) \ + for (bvl = bio_iovec((bio)), i = (start_idx); \
Hope this helps.
Signature · 1 line
Randy Hron
Quoted 7 lines · On Fri, Dec 07 2001, [email protected] wrote:
Quoted 3 lines · Jens Axboe
Quoted 1 line
argh, that should read 'i' and not '0' of course.
Updated patch follows.
I got a very similar oops during mkreiserfs
/dev/loop0on this HIGHMEM machine.
loop can't be trusted yet. btw, updated patch on kernel.org, /pub/linux/kernel/people/axboe/patches/v2.5/2.5.1-pre6
Signature · 1 line
Jens Axboe
Quoted 5 lines · Jens Axboe
Quoted 2 lines
I got a very similar oops during mkreiserfs
/dev/loop0on this HIGHMEM machine.loop can't be trusted yet. btw, updated patch on kernel.org, /pub/linux/kernel/people/axboe/patches/v2.5/2.5.1-pre6
It's a lot better with bio-pre6-2. :) No more oops. mkreiserfs, mount, cpio into the loop filesystem work now. sync will hang on /dev/loop0 though.
It's amazing what you get done in one day.
Signature · 1 line
Randy Hron
Quoted 2 lines · Jens Axboe
loop can't be trusted yet. btw, updated patch on kernel.org, /pub/linux/kernel/people/axboe/patches/v2.5/2.5.1-pre6
mkreiserfs on loop is working again in 2.5.1-pre8.
Linux test project runalltests.sh finished with no new regressions.
growfiles did more iterations in 760 seconds than I've measured before.
Signature · 1 line
Randy Hron
Quoted 11 lines · On Sun, Dec 09 2001, [email protected] wrote:
Quoted 2 lines · Jens Axboe
loop can't be trusted yet. btw, updated patch on kernel.org, /pub/linux/kernel/people/axboe/patches/v2.5/2.5.1-pre6
mkreiserfs on loop is working again in 2.5.1-pre8.
Linux test project
runalltests.shfinished with no new regressions.growfiles did more iterations in 760 seconds than I've measured before.
Excellent, thanks for the feedback.
Signature · 1 line
Jens Axboe