harsh97 / compcache

Automatically exported from code.google.com/p/compcache
1 stars 0 forks source link

kernel error writing on zram #105

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compiled zram builtin in kernel
2. boot the new kernel, initialize zram with:
   echo $(( 64*1024*1024)) > /sys/block/zram0/disksize
3. mkswap /dev/zram0

mkswap hang (is not killable, even with kill -9)
dmesg show those errors:

mkswap: page allocation failure: order:4, mode:0xc0d0
[<c000d55c>] (unwind_backtrace+0x0/0xf0) from [<c0086704>] 
(warn_alloc_failed+0xec/0x118)
[<c0086704>] (warn_alloc_failed+0xec/0x118) from [<c00871f0>] 
(__alloc_pages_nodemask+0x570/0x610)
[<c00871f0>] (__alloc_pages_nodemask+0x570/0x610) from [<c0087308>] 
(__get_free_pages+0x10/0x3c)
[<c0087308>] (__get_free_pages+0x10/0x3c) from [<c00af9b0>] 
(kmalloc_order_trace+0x20/0x80)
[<c00af9b0>] (kmalloc_order_trace+0x20/0x80) from [<c0381878>] 
(zram_init_device+0xb8/0x1e4)
[<c0381878>] (zram_init_device+0xb8/0x1e4) from [<c03819c8>] 
(zram_make_request+0x24/0x26c)
[<c03819c8>] (zram_make_request+0x24/0x26c) from [<c0243c40>] 
(generic_make_request+0x90/0xd4)
[<c0243c40>] (generic_make_request+0x90/0xd4) from [<c0243d98>] 
(submit_bio+0x114/0x130)
[<c0243d98>] (submit_bio+0x114/0x130) from [<c00d99a8>] (submit_bh+0x164/0x184)
[<c00d99a8>] (submit_bh+0x164/0x184) from [<c00dd6e8>] 
(block_read_full_page+0x35c/0x380)
[<c00dd6e8>] (block_read_full_page+0x35c/0x380) from [<c00899e8>] 
(__do_page_cache_readahead+0x1a0/0x1f4)
[<c00899e8>] (__do_page_cache_readahead+0x1a0/0x1f4) from [<c0089adc>] 
(force_page_cache_readahead+0x78/0xb8)
[<c0089adc>] (force_page_cache_readahead+0x78/0xb8) from [<c008280c>] 
(generic_file_aio_read+0x2d4/0x734)
[<c008280c>] (generic_file_aio_read+0x2d4/0x734) from [<c00b36b8>] 
(do_sync_read+0x90/0xcc)
[<c00b36b8>] (do_sync_read+0x90/0xcc) from [<c00b4468>] (vfs_read+0xa8/0x180)
[<c00b4468>] (vfs_read+0xa8/0x180) from [<c00b45ec>] (sys_read+0x3c/0x68)
[<c00b45ec>] (sys_read+0x3c/0x68) from [<c0008c60>] (ret_fast_syscall+0x0/0x2c)
Mem-info:
Normal per-cpu:
CPU    0: hi:  186, btch:  31 usd:   0
active_anon:8557 inactive_anon:21856 isolated_anon:0
 active_file:48234 inactive_file:36667 isolated_file:0
 unevictable:0 dirty:0 writeback:45 unstable:0
 free:3629 slab_reclaimable:4964 slab_unreclaimable:1619
 mapped:7831 shmem:2 pagetables:665 bounce:0
Normal free:14516kB min:2884kB low:3604kB high:4324kB active_anon:34228kB 
inactive_anon:87424kB active_file:192936kB inactive_file:146668kB 
unevictable:0kB isolated(anon):0kB isolated(file):0kB present:520192kB 
mlocked:0kB dirty:0kB writeback:180kB mapped:31324kB shmem:8kB 
slab_reclaimable:19856kB slab_unreclaimable:6476kB kernel_stack:1336kB 
pagetables:2660kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 
all_unreclaimable? no
lowmem_reserve[]: 0 0
Normal: 1483*4kB 685*8kB 164*16kB 11*32kB 2*64kB 0*128kB 0*256kB 0*512kB 
0*1024kB 0*2048kB 0*4096kB = 14516kB
85051 total pagecache pages
148 pages in swap cache
Swap cache stats: add 824, delete 676, find 44/58
Free swap  = 99668kB
Total swap = 102396kB
131072 pages of RAM
4105 free pages
2819 reserved pages
5782 slab pages
80269 pages shared
148 pages swap cached
zram: Error allocating compressor working memory!
Unable to handle kernel NULL pointer dereference at virtual address 00000018
pgd = dc6ec000
[00000018] *pgd=1c5f7831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] ARM
Modules linked in:
CPU: 0    Not tainted  (3.6.6 #7)
PC is at zs_destroy_pool+0x18/0x6c
LR is at __zram_reset_device+0x90/0xb0
pc : [<c038641c>]    lr : [<c03817a0>]    psr: 80000013
sp : df1f5c28  ip : 00000000  fp : 00000000
r10: 00026000  r9 : 00001000  r8 : 00000000
r7 : 00000000  r6 : 00001fe0  r5 : 00000000  r4 : 00000000
r3 : 00000000  r2 : df1f5c38  r1 : 00000001  r0 : 00000000
Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 1c6ec000  DAC: 00000015
Process mkswap (pid: 11053, stack limit = 0xdf1f4270)
Stack: (0xdf1f5c28 to 0xdf1f6000)
5c20:                   df13af00 00000000 00000000 c03817a0 df13af00 df13af28
5c40: 04000000 c038195c df3e4700 df13af00 df3e4700 00000000 00000000 c03819c8
5c60: d4d25268 df83c9c0 df1f5da0 b6f6c000 00000000 c047576c deb11de0 df83c9c0
5c80: df1f5d14 df1f4000 00000000 df3e4700 00000000 00000000 00001000 00026000
5ca0: 00000000 c0243c40 00000000 00000000 df3e4700 00000008 00027000 c0243d98
5cc0: c00d94f4 c00b0004 df805500 cec24fc0 df866d80 df3e4700 df866d80 df3e4700
5ce0: 00000010 c00de78c df3e4700 c00df3ac 00000010 cec24fc0 df3e4700 00000000
5d00: df1f5d48 df56dcb8 00001000 00000001 00000000 c00d99a8 00000000 df1f5d48
5d20: c00dc098 c00dd6e8 cec24fc0 00000000 00000000 00000000 cec24fc0 c00df594
5d40: 00004000 00000000 cec24fc0 df56dd74 00000000 00000000 00100100 00000001
5d60: 00200200 c0080e88 c0a8f620 c0a8f620 df56dd74 00000001 00000001 00100100
5d80: 00000001 00200200 df56dd78 c00899e8 00003fff 00000000 00000020 df3e4800
5da0: 91827364 df1f5da4 df1f5da4 df1f5dac df1f5dac 00000000 df1f5db8 df1f5db8
5dc0: 00000000 00000000 00000001 00000000 00000001 df56dd74 000001ff df3e4800
5de0: 00000000 c0089adc 00000000 df3e4800 00000000 00000000 00000000 00000000
5e00: df3e4800 df56dd74 00000000 00000fff ffffffff c008280c 00000001 00000028
5e20: 00000000 00000000 df1f5f00 00000000 00000001 00000000 00000008 00000000
5e40: df1f5f38 00000000 debbf180 dc6eedb8 00000028 d4d259f8 df3e4840 df56dcb8
5e60: df1f5ef0 df3e4808 00000001 00000001 d4d259f8 00000000 00000400 00e92868
5e80: 00000000 00000000 50a752b5 df1f5f38 df1f5eb8 df3e4800 df1f5f80 fffffdee
5ea0: 00000000 df83c9c0 00000400 c00b36b8 00000000 00000000 00000000 00000000
5ec0: 00000000 00000001 ffffffff df3e4800 00000000 00000000 00000000 00000000
5ee0: df83c9c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5f00: 00000400 00000000 00000400 00000000 00000000 00000000 00000000 00000000
5f20: 00000000 00000000 00000000 00000000 00000000 00000000 00e92868 00000400
5f40: 00000000 00000400 df3e4800 00e92868 df1f5f80 00000000 00000000 c00b4468
5f60: df3e4800 00e92868 df3e4800 00e92868 00000400 00000003 00000000 c00b45ec
5f80: 00000000 00000000 00000400 00000000 00e921ec 00000000 00000000 c0008dc4
5fa0: df1f4000 c0008c60 00e921ec 00000000 00000004 00e92868 00000400 00008000
5fc0: 00e921ec 00000000 00000000 00000003 00e921c0 00e92848 00e92860 00000400
5fe0: 00e92848 bea32758 b6f22730 b6e5874c 60000010 00000004 00000000 00000000
[<c038641c>] (zs_destroy_pool+0x18/0x6c) from [<c03817a0>] 
(__zram_reset_device+0x90/0xb0)
[<c03817a0>] (__zram_reset_device+0x90/0xb0) from [<c038195c>] 
(zram_init_device+0x19c/0x1e4)
[<c038195c>] (zram_init_device+0x19c/0x1e4) from [<c03819c8>] 
(zram_make_request+0x24/0x26c)
[<c03819c8>] (zram_make_request+0x24/0x26c) from [<c0243c40>] 
(generic_make_request+0x90/0xd4)
[<c0243c40>] (generic_make_request+0x90/0xd4) from [<c0243d98>] 
(submit_bio+0x114/0x130)
[<c0243d98>] (submit_bio+0x114/0x130) from [<c00d99a8>] (submit_bh+0x164/0x184)
[<c00d99a8>] (submit_bh+0x164/0x184) from [<c00dd6e8>] 
(block_read_full_page+0x35c/0x380)
[<c00dd6e8>] (block_read_full_page+0x35c/0x380) from [<c00899e8>] 
(__do_page_cache_readahead+0x1a0/0x1f4)
[<c00899e8>] (__do_page_cache_readahead+0x1a0/0x1f4) from [<c0089adc>] 
(force_page_cache_readahead+0x78/0xb8)
[<c0089adc>] (force_page_cache_readahead+0x78/0xb8) from [<c008280c>] 
(generic_file_aio_read+0x2d4/0x734)
[<c008280c>] (generic_file_aio_read+0x2d4/0x734) from [<c00b36b8>] 
(do_sync_read+0x90/0xcc)
[<c00b36b8>] (do_sync_read+0x90/0xcc) from [<c00b4468>] (vfs_read+0xa8/0x180)
[<c00b4468>] (vfs_read+0xa8/0x180) from [<c00b45ec>] (sys_read+0x3c/0x68)
[<c00b45ec>] (sys_read+0x3c/0x68) from [<c0008c60>] (ret_fast_syscall+0x0/0x2c)
Code: e1a05000 e2866020 e1a04000 ea00000e (e5943018) 
---[ end trace 98a7c75b00627714 ]---

What version of the product are you using? On what operating system?

Kernel 3.6.6 on a sheeva plug (armv5te platform)

Original issue reported on code.google.com by diego.ro...@gmail.com on 17 Nov 2012 at 8:12

GoogleCodeExporter commented 9 years ago
zram is failing to allocate some buffers during initialization. You seem to be 
loading the module when you are nearly out of memory (just 4105 pages free). 
Don't know about your setup but can you try loading the module, say during 
startup when there is enough free RAM?

OTOH: the module should gracefully refuse to load rather than crashing like 
this.

Original comment by nitingupta910@gmail.com on 29 Nov 2012 at 9:28