stec-inc/EnhanceIO

Cannot Allocate Memory

Closed this issue · 4 comments

I get the following error when trying to create the cache:

Cache Name : SSD_Cache
Source Device : /dev/md2
SSD Device : /dev/sdd
Policy : lru
Mode : Write Through
Block Size : 4096
Associativity : 256
[Errno 12] Cannot allocate memory
Cache creation failed (dmesg can provide you more info)

dmesg:

[ 1008.591342] enhanceio: Setting mode to write through
[ 1008.591351] get_policy: policy 2 found
[ 1008.591358] enhanceio_lru: eio_lru_instance_init: created new instance of LRU
[ 1008.591361] enhanceio: Setting replacement policy to lru (2)
[ 1008.592027] Not enough sets to use small metadata
[ 1008.592033] enhanceio: Allocate 61358KB (8B per) mem for 7853824-entry cache (capacity:30798MB, associativity:256, block size:4096 bytes)
[ 1008.592071] vmap allocation for size 62836736 failed: use vmalloc= to increase size.
[ 1008.592076] vmalloc: allocation failure: 62830592 bytes
[ 1008.592079] eio_cli: page allocation failure: order:0, mode:0xd2
[ 1008.592085] CPU: 1 PID: 1939 Comm: eio_cli Tainted: G O 3.14.6-1-ARCH #1
[ 1008.592087] Hardware name: Dell Computer Corporation OptiPlex GX270 /0U1325, BIOS A07 06/26/2006
[ 1008.592091] 00000000 5febdb33 00000000 e192bc6c c144aba8 c1527cd4 e192bc9c c1113d00
[ 1008.592101] c1526354 e6d466c4 00000000 000000d2 e192bcb0 c1527cd4 e192bc84 5febdb33
[ 1008.592109] 03beb800 00000000 e192bccc c11425bf 000000d2 00000000 c1527cd4 03beb800
[ 1008.592118] Call Trace:
[ 1008.592131] [] dump_stack+0x48/0x69
[ 1008.592139] [] warn_alloc_failed+0xd0/0x110
[ 1008.592146] [] __vmalloc_node_range+0x15f/0x1f0
[ 1008.592151] [] __vmalloc_node+0x54/0x60
[ 1008.592160] [] ? eio_md_create+0xb05/0xe40 [enhanceio]
[ 1008.592165] [] vmalloc+0x30/0x40
[ 1008.592171] [] ? eio_md_create+0xb05/0xe40 [enhanceio]
[ 1008.592177] [] eio_md_create+0xb05/0xe40 [enhanceio]
[ 1008.592183] [] ? wake_up_klogd+0x34/0x50
[ 1008.592188] [] ? printk+0x1c/0x1e
[ 1008.592195] [] eio_cache_create+0x692/0x1b50 [enhanceio]
[ 1008.592203] [] ? kmem_cache_alloc_trace+0x7c/0x1e0
[ 1008.592207] [] ? __insert_vmap_area+0x68/0xc0
[ 1008.592212] [] ? vmap_page_range_noflush+0xf8/0x180
[ 1008.592216] [] ? __vmalloc_node_range+0x175/0x1f0
[ 1008.592222] [] ? eio_ioctl+0x276/0x2d0 [enhanceio]
[ 1008.592227] [] ? __vmalloc_node+0x54/0x60
[ 1008.592233] [] ? eio_ioctl+0x276/0x2d0 [enhanceio]
[ 1008.592238] [] eio_ioctl+0x297/0x2d0 [enhanceio]
[ 1008.592244] [] ? eio_get_device_start_sect+0x30/0x30 [enhanceio]
[ 1008.592251] [] do_vfs_ioctl+0x2f2/0x4e0
[ 1008.592258] [] ? SyS_fstat64+0x33/0x50
[ 1008.592262] [] SyS_ioctl+0x80/0x90
[ 1008.592269] [] sysenter_do_call+0x12/0x2c
[ 1008.592271] Mem-Info:
[ 1008.592274] DMA per-cpu:
[ 1008.592277] CPU 0: hi: 0, btch: 1 usd: 0
[ 1008.592280] CPU 1: hi: 0, btch: 1 usd: 0
[ 1008.592282] Normal per-cpu:
[ 1008.592285] CPU 0: hi: 186, btch: 31 usd: 182
[ 1008.592287] CPU 1: hi: 186, btch: 31 usd: 35
[ 1008.592289] HighMem per-cpu:
[ 1008.592292] CPU 0: hi: 42, btch: 7 usd: 35
[ 1008.592294] CPU 1: hi: 42, btch: 7 usd: 29
[ 1008.592300] active_anon:21333 inactive_anon:29 isolated_anon:0
active_file:7957 inactive_file:58679 isolated_file:0
unevictable:0 dirty:140 writeback:0 unstable:0
free:143114 slab_reclaimable:3090 slab_unreclaimable:1764
mapped:11966 shmem:118 pagetables:301 bounce:0
free_cma:0
[ 1008.592313] DMA free:4920kB min:788kB low:984kB high:1180kB active_anon:5072kB inactive_anon:0kB active_file:356kB inactive_file:4632kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15996kB managed:15916kB mlocked:0kB dirty:0kB writeback:0kB mapped:944kB shmem:4kB slab_reclaimable:108kB slab_unreclaimable:36kB kernel_stack:24kB pagetables:12kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
[ 1008.592315] lowmem_reserve[]: 0 853 988 988
[ 1008.592326] Normal free:487656kB min:43424kB low:54280kB high:65136kB active_anon:65584kB inactive_anon:92kB active_file:29304kB inactive_file:197256kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:892920kB managed:874432kB mlocked:0kB dirty:552kB writeback:0kB mapped:40064kB shmem:404kB slab_reclaimable:12252kB slab_unreclaimable:7020kB kernel_stack:1184kB pagetables:1192kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
[ 1008.592329] lowmem_reserve[]: 0 0 1083 1083
[ 1008.592339] HighMem free:79880kB min:132kB low:1852kB high:3576kB active_anon:14676kB inactive_anon:24kB active_file:2168kB inactive_file:32828kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:138696kB managed:138696kB mlocked:0kB dirty:8kB writeback:0kB mapped:6856kB shmem:64kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
[ 1008.592342] lowmem_reserve[]: 0 0 0 0
[ 1008.592347] DMA: 16_4kB (UM) 9_8kB (UM) 1_16kB (U) 3_32kB (UM) 1_64kB (M) 2_128kB (U) 3_256kB (U) 3_512kB (U) 2_1024kB (M) 0_2048kB 0_4096kB = 4920kB
[ 1008.592369] Normal: 34_4kB (UM) 31_8kB (UEM) 67_16kB (UEM) 33_32kB (UEM) 21_64kB (UEM) 4_128kB (EM) 4_256kB (EM) 4_512kB (UEM) 1_1024kB (U) 2_2048kB (EM) 116_4096kB (MR) = 487696kB
[ 1008.592391] HighMem: 2_4kB (UM) 2_8kB (UM) 1_16kB (M) 1_32kB (M) 1_64kB (U) 1_128kB (M) 3_256kB (UM) 2_512kB (M) 2_1024kB (UM) 1_2048kB (U) 18*4096kB (MR) = 79880kB
[ 1008.592415] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=4096kB
[ 1008.592417] 66752 total pagecache pages
[ 1008.592421] 0 pages in swap cache
[ 1008.592423] Swap cache stats: add 0, delete 0, find 0/0
[ 1008.592426] Free swap = 12581372kB
[ 1008.592427] Total swap = 12581372kB
[ 1008.592430] 261903 pages RAM
[ 1008.592432] 34674 pages HighMem/MovableOnly
[ 1008.592434] 0 pages reserved
[ 1008.592435] 0 pages hwpoisoned
[ 1008.592438] enhanceio: md_create: Unable to allocate cache md for cache "SSD_Cache".
[ 1008.592490] enhanceio: Cache creation failed: Failed to force create cache.

I'm on arch linux x86, fully up to date, with the latest enhanceio. I'm trying to create an SSD cache for a raid array, but I also tried it on a normal single hdd and it produced the exact same error. I can't find anything on the web to indicate what is wrong, so I need some help please :)

Now getting Error 16: Device or resource busy :S

Hello goastler,

The error "[ 1008.592071] vmap allocation for size 62836736 failed: use vmalloc= to increase size." suggests that memory allocation failed for memory of size ~62MB. It looks like you do not have sufficient reserved vmap space on your machine.

  1. You can use "vmalloc=512M" as kernel boot command line parameter to increase vmap reserved space. Minimum size of vmalloc area on x86 is 128MB. You can modify grub file and add boot parameter "vmalloc=" to better suit your configuration. Reboot the system after making this change.
  2. You can verify the current vmalloc reserved space using following command.
    #> cat /proc/meminfo | grep -i vmalloc

This would depict the Total and used vmalloc space. You may get clue from this around why memory allocation is failing. Please check if total available vmalloc area is below 62 MB.

Hope this helps.

Regards,
Akhil

That sorted it :) I'm only on a gig of ram so I've set the vmalloc to 256M, but that shows up as being adequate using the grep command you gave. Thanks very much!

Closing as it is sorted out for now! :)