---------- Forwarded message ----------
From: sandrain <reply+i-3790568-49f31222696ef25...@reply.github.com>
Date: Sat, Mar 24, 2012 at 1:28 AM
Subject: [dm-cache] testing dm-cache (#2)
To: Ming Zhao <mingzh...@gmail.com>
Hi, thanks for nice works.
I'm trying dm-cache 3.0.8. I like to configure it like
/dev/sda (ssd) : cache device
/dev/sdd (hdd): source device
========================================================
<pre>
Disk /dev/sda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sda doesn't contain a valid partition table
Disk /dev/sdd: 500.1 GB, 500107862016 bytes
81 heads, 63 sectors/track, 191411 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd091d92e
Device Boot Start End Blocks Id System
/dev/sdd1 2048 976773167 488385560 83 Linux
</pre>
========================================================
And I tried the following command to initialize it:
(I think it would be better if I don't have to calculate the number of
blocks in cache dev. I just like to whole ssd as a cache)
echo 0 976773168 cache /dev/sdd /dev/sda 0 8 7864320 1024 0 | dmsetup
create cache1
where,
0 976773168 : whole sector range of /dev/sdd
0 8: block size = 512 * 8 = 4k
7864320: 30G cache space = 30*1024*1024*1024/4096 blocks (It's around
half of its capacity)
and it fails.
My machine is
- i686 Intel(R) Pentium(R) D CPU 3.00GHz GenuineIntel GNU/Linux
- 1.5 GB RAM
- Gentoo Linux, kernel-3.2.2 (vanillia)
<pre>
[ 1814.716320] ------------[ cut here ]------------
[ 1814.716337] WARNING: at fs/block_dev.c:937
bd_unlink_disk_holder+0x1d6/0x1f0()
[ 1814.716344] Hardware name: OptiPlex GX620
[ 1814.716349] Modules linked in: dm_cache(O)
[ 1814.716363] Pid: 3069, comm: dmsetup Tainted: G O 3.2.2 #1
[ 1814.716373] Call Trace:
[ 1814.716387] [<c106e6fc>] warn_slowpath_common+0xdc/0x160
[ 1814.716397] [<c122c3a6>] ? bd_unlink_disk_holder+0x1d6/0x1f0
[ 1814.716406] [<c122c3a6>] ? bd_unlink_disk_holder+0x1d6/0x1f0
[ 1814.716416] [<c106e7be>] warn_slowpath_null+0x3e/0x50
[ 1814.716425] [<c122c3a6>] bd_unlink_disk_holder+0x1d6/0x1f0
[ 1814.716437] [<c191361d>] close_dev+0x4d/0x90
[ 1814.716445] [<c19136b7>] dm_put_device+0x57/0xa0
[ 1814.716457] [<f880ecb2>] cache_ctr+0x462/0x1840 [dm_cache]
[ 1814.716469] [<c153a785>] ? _copy_from_user+0x45/0x90
[ 1814.716484] [<c1b1c723>] ? _raw_write_unlock+0x43/0xa0
[ 1814.716495] [<c19132ff>] ? realloc_argv+0x3f/0xc0
[ 1814.716503] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.716513] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.716524] [<c19133e7>] ? dm_split_args+0x67/0x250
[ 1814.716536] [<c19149d6>] dm_table_add_target+0x176/0x630
[ 1814.716546] [<c19147cb>] ? alloc_targets+0x8b/0x120
[ 1814.716559] [<c19189ec>] table_load+0x18c/0x670
[ 1814.716571] [<c191abfd>] dm_ctl_ioctl+0x1cd/0x480
[ 1814.716582] [<c1918860>] ? table_clear+0x100/0x100
[ 1814.716591] [<c191aa30>] ? copy_params+0x220/0x220
[ 1814.716601] [<c11ef224>] do_vfs_ioctl+0xa4/0xa80
[ 1814.716610] [<c1b227bd>] ? sub_preempt_count+0x7d/0xa0
[ 1814.716620] [<c1205498>] ? vfsmount_lock_local_unlock+0x58/0xb0
[ 1814.716629] [<c1205549>] ? mntput_no_expire+0x59/0x290
[ 1814.716640] [<c14d1ac3>] ? sys_semctl+0xe3/0x140
[ 1814.716652] [<c11efc76>] sys_ioctl+0x76/0xd0
[ 1814.716662] [<c1b28810>] sysenter_do_call+0x12/0x2b
[ 1814.716673] [<c138fd09>] ? do_one_pass+0x4f9/0x8e0
[ 1814.716683] ---[ end trace 798168b08048292b ]---
[ 1814.716688] ------------[ cut here ]------------
[ 1814.716696] WARNING: at fs/block_dev.c:1478 blkdev_put+0x20c/0x260()
[ 1814.716701] Hardware name: OptiPlex GX620
[ 1814.716705] Modules linked in: dm_cache(O)
[ 1814.716715] Pid: 3069, comm: dmsetup Tainted: G W O 3.2.2 #1
[ 1814.716720] Call Trace:
[ 1814.716729] [<c106e6fc>] warn_slowpath_common+0xdc/0x160
[ 1814.716738] [<c122da2c>] ? blkdev_put+0x20c/0x260
[ 1814.716746] [<c122da2c>] ? blkdev_put+0x20c/0x260
[ 1814.716755] [<c106e7be>] warn_slowpath_null+0x3e/0x50
[ 1814.716763] [<c122da2c>] blkdev_put+0x20c/0x260
[ 1814.716771] [<c1913639>] close_dev+0x69/0x90
[ 1814.716779] [<c19136b7>] dm_put_device+0x57/0xa0
[ 1814.716789] [<f880ecb2>] cache_ctr+0x462/0x1840 [dm_cache]
[ 1814.716799] [<c153a785>] ? _copy_from_user+0x45/0x90
[ 1814.716811] [<c1b1c723>] ? _raw_write_unlock+0x43/0xa0
[ 1814.716820] [<c19132ff>] ? realloc_argv+0x3f/0xc0
[ 1814.716827] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.716835] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.716844] [<c19133e7>] ? dm_split_args+0x67/0x250
[ 1814.716853] [<c19149d6>] dm_table_add_target+0x176/0x630
[ 1814.716861] [<c19147cb>] ? alloc_targets+0x8b/0x120
[ 1814.716871] [<c19189ec>] table_load+0x18c/0x670
[ 1814.716880] [<c191abfd>] dm_ctl_ioctl+0x1cd/0x480
[ 1814.716889] [<c1918860>] ? table_clear+0x100/0x100
[ 1814.716898] [<c191aa30>] ? copy_params+0x220/0x220
[ 1814.716906] [<c11ef224>] do_vfs_ioctl+0xa4/0xa80
[ 1814.716914] [<c1b227bd>] ? sub_preempt_count+0x7d/0xa0
[ 1814.716922] [<c1205498>] ? vfsmount_lock_local_unlock+0x58/0xb0
[ 1814.716930] [<c1205549>] ? mntput_no_expire+0x59/0x290
[ 1814.716939] [<c14d1ac3>] ? sys_semctl+0xe3/0x140
[ 1814.716948] [<c11efc76>] sys_ioctl+0x76/0xd0
[ 1814.716957] [<c1b28810>] sysenter_do_call+0x12/0x2b
[ 1814.716965] [<c138fd09>] ? do_one_pass+0x4f9/0x8e0
[ 1814.716972] ---[ end trace 798168b08048292c ]---
[ 1814.716977] ------------[ cut here ]------------
[ 1814.716984] WARNING: at fs/block_dev.c:1479 blkdev_put+0x243/0x260()
[ 1814.716989] Hardware name: OptiPlex GX620
[ 1814.716994] Modules linked in: dm_cache(O)
[ 1814.717003] Pid: 3069, comm: dmsetup Tainted: G W O 3.2.2 #1
[ 1814.717040] Call Trace:
[ 1814.717050] [<c106e6fc>] warn_slowpath_common+0xdc/0x160
[ 1814.717059] [<c122da63>] ? blkdev_put+0x243/0x260
[ 1814.717067] [<c122da63>] ? blkdev_put+0x243/0x260
[ 1814.717076] [<c106e7be>] warn_slowpath_null+0x3e/0x50
[ 1814.717084] [<c122da63>] blkdev_put+0x243/0x260
[ 1814.717093] [<c1913639>] close_dev+0x69/0x90
[ 1814.717101] [<c19136b7>] dm_put_device+0x57/0xa0
[ 1814.717111] [<f880ecb2>] cache_ctr+0x462/0x1840 [dm_cache]
[ 1814.717121] [<c153a785>] ? _copy_from_user+0x45/0x90
[ 1814.717133] [<c1b1c723>] ? _raw_write_unlock+0x43/0xa0
[ 1814.717143] [<c19132ff>] ? realloc_argv+0x3f/0xc0
[ 1814.717151] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.717159] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.717167] [<c19133e7>] ? dm_split_args+0x67/0x250
[ 1814.717177] [<c19149d6>] dm_table_add_target+0x176/0x630
[ 1814.717186] [<c19147cb>] ? alloc_targets+0x8b/0x120
[ 1814.717195] [<c19189ec>] table_load+0x18c/0x670
[ 1814.717205] [<c191abfd>] dm_ctl_ioctl+0x1cd/0x480
[ 1814.717215] [<c1918860>] ? table_clear+0x100/0x100
[ 1814.717224] [<c191aa30>] ? copy_params+0x220/0x220
[ 1814.717232] [<c11ef224>] do_vfs_ioctl+0xa4/0xa80
[ 1814.717240] [<c1b227bd>] ? sub_preempt_count+0x7d/0xa0
[ 1814.717249] [<c1205498>] ? vfsmount_lock_local_unlock+0x58/0xb0
[ 1814.717257] [<c1205549>] ? mntput_no_expire+0x59/0x290
[ 1814.717266] [<c14d1ac3>] ? sys_semctl+0xe3/0x140
[ 1814.717276] [<c11efc76>] sys_ioctl+0x76/0xd0
[ 1814.717285] [<c1b28810>] sysenter_do_call+0x12/0x2b
[ 1814.717294] [<c138fd09>] ? do_one_pass+0x4f9/0x8e0
[ 1814.717302] ---[ end trace 798168b08048292d ]---
[ 1814.724116] ------------[ cut here ]------------
[ 1814.724128] WARNING: at fs/block_dev.c:1431 __blkdev_put+0x2c1/0x2e0()
[ 1814.724134] Hardware name: OptiPlex GX620
[ 1814.724139] Modules linked in: dm_cache(O)
[ 1814.724152] Pid: 3069, comm: dmsetup Tainted: G W O 3.2.2 #1
[ 1814.724158] Call Trace:
[ 1814.724169] [<c106e6fc>] warn_slowpath_common+0xdc/0x160
[ 1814.724181] [<c122d801>] ? __blkdev_put+0x2c1/0x2e0
[ 1814.724189] [<c122d801>] ? __blkdev_put+0x2c1/0x2e0
[ 1814.724199] [<c106e7be>] warn_slowpath_null+0x3e/0x50
[ 1814.724208] [<c122d801>] __blkdev_put+0x2c1/0x2e0
[ 1814.724220] [<c1512b87>] ? disk_flush_events+0x67/0x100
[ 1814.724229] [<c122d89f>] blkdev_put+0x7f/0x260
[ 1814.724239] [<c1913639>] close_dev+0x69/0x90
[ 1814.724247] [<c19136b7>] dm_put_device+0x57/0xa0
[ 1814.724258] [<f880ecb2>] cache_ctr+0x462/0x1840 [dm_cache]
[ 1814.724270] [<c153a785>] ? _copy_from_user+0x45/0x90
[ 1814.724284] [<c1b1c723>] ? _raw_write_unlock+0x43/0xa0
[ 1814.724294] [<c19132ff>] ? realloc_argv+0x3f/0xc0
[ 1814.724302] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.724311] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.724321] [<c19133e7>] ? dm_split_args+0x67/0x250
[ 1814.724333] [<c19149d6>] dm_table_add_target+0x176/0x630
[ 1814.724342] [<c19147cb>] ? alloc_targets+0x8b/0x120
[ 1814.724354] [<c19189ec>] table_load+0x18c/0x670
[ 1814.724366] [<c191abfd>] dm_ctl_ioctl+0x1cd/0x480
[ 1814.724377] [<c1918860>] ? table_clear+0x100/0x100
[ 1814.724387] [<c191aa30>] ? copy_params+0x220/0x220
[ 1814.724396] [<c11ef224>] do_vfs_ioctl+0xa4/0xa80
[ 1814.724405] [<c1b227bd>] ? sub_preempt_count+0x7d/0xa0
[ 1814.724415] [<c1205498>] ? vfsmount_lock_local_unlock+0x58/0xb0
[ 1814.724424] [<c1205549>] ? mntput_no_expire+0x59/0x290
[ 1814.724435] [<c14d1ac3>] ? sys_semctl+0xe3/0x140
[ 1814.724447] [<c11efc76>] sys_ioctl+0x76/0xd0
[ 1814.724457] [<c1b28810>] sysenter_do_call+0x12/0x2b
[ 1814.724467] [<c138fd09>] ? do_one_pass+0x4f9/0x8e0
[ 1814.724477] ---[ end trace 798168b08048292e ]---
[ 1814.724496] BUG: unable to handle kernel NULL pointer dereference at 00000004
[ 1814.724583] IP: [<c19136cb>] dm_put_device+0x6b/0xa0
[ 1814.724637] *pde = 00000000
[ 1814.724670] Oops: 0002 [#1] PREEMPT SMP
[ 1814.724719] Modules linked in: dm_cache(O)
[ 1814.724766]
[ 1814.724785] Pid: 3069, comm: dmsetup Tainted: G W O 3.2.2
#1 Dell Inc. OptiPlex GX620 /0ND237
[ 1814.724902] EIP: 0060:[<c19136cb>] EFLAGS: 00010246 CPU: 0
[ 1814.724955] EIP is at dm_put_device+0x6b/0xa0
[ 1814.724997] EAX: 00200200 EBX: f5ab054c ECX: 00000000 EDX: 00000000
[ 1814.725015] ESI: f5ab0540 EDI: ffffffea EBP: f5b8fd48 ESP: f5b8fd40
[ 1814.725015] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[ 1814.725015] Process dmsetup (pid: 3069, ti=f5b8e000 task=f56443f0
task.ti=f5b8e000)
[ 1814.725015] Stack:
[ 1814.725015] f84fe080 f5bae500 f5b8fe44 f880ecb2 f84f9176 f88117ba
f5b8fe24 00000000
[ 1814.725015] f5b8fd74 c153a785 00000000 f5a13ec0 f5a13f20 f5b8fdb0
f5ab0480 00000000
[ 1814.725015] 00000246 00000000 f7ffe000 80100010 00000003 00000001
000000eb 00000000
[ 1814.725015] Call Trace:
[ 1814.725015] [<f880ecb2>] cache_ctr+0x462/0x1840 [dm_cache]
[ 1814.725015] [<c153a785>] ? _copy_from_user+0x45/0x90
[ 1814.725015] [<c1b1c723>] ? _raw_write_unlock+0x43/0xa0
[ 1814.725015] [<c19132ff>] ? realloc_argv+0x3f/0xc0
[ 1814.725015] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.725015] [<c1913339>] ? realloc_argv+0x79/0xc0
[ 1814.725015] [<c19133e7>] ? dm_split_args+0x67/0x250
[ 1814.725015] [<c19149d6>] dm_table_add_target+0x176/0x630
[ 1814.725015] [<c19147cb>] ? alloc_targets+0x8b/0x120
[ 1814.725015] [<c19189ec>] table_load+0x18c/0x670
[ 1814.725015] [<c191abfd>] dm_ctl_ioctl+0x1cd/0x480
[ 1814.725015] [<c1918860>] ? table_clear+0x100/0x100
[ 1814.725015] [<c191aa30>] ? copy_params+0x220/0x220
[ 1814.725015] [<c11ef224>] do_vfs_ioctl+0xa4/0xa80
[ 1814.725015] [<c1b227bd>] ? sub_preempt_count+0x7d/0xa0
[ 1814.725015] [<c1205498>] ? vfsmount_lock_local_unlock+0x58/0xb0
[ 1814.725015] [<c1205549>] ? mntput_no_expire+0x59/0x290
[ 1814.725015] [<c14d1ac3>] ? sys_semctl+0xe3/0x140
[ 1814.725015] [<c11efc76>] sys_ioctl+0x76/0xd0
[ 1814.725015] [<c1b28810>] sysenter_do_call+0x12/0x2b
[ 1814.725015] [<c138fd09>] ? do_one_pass+0x4f9/0x8e0
[ 1814.725015] Code: 60 01 2a c2 01 83 15 64 01 2a c2 00 8b 00 8b 10
89 f0 e8 19 ff ff ff 83 05 68 01 2a c2 01 83 15 6c 01 2a c2 00 8b 46
04 8b 53 f4 <89> 42 04 89 10 89 f0 c7 43 f4 00 01 10 00 c7 46 04 00 02
20 00
[ 1814.725015] EIP: [<c19136cb>] dm_put_device+0x6b/0xa0 SS:ESP 0068:f5b8fd40
[ 1814.725015] CR2: 0000000000000004
[ 1814.736052] ---[ end trace 798168b08048292f ]---
</pre>
---
Reply to this email directly or view it on GitHub:
https://github.com/mingzhao/dm-cache/issues/2
Hello Sandrain,
First of all, thank you for your interest in DM-cache and for your thoroughness.
It appears that the creation function of DM-cache is failing and
produces a stack trace when it tries to put_device(). First of all, I
would suggest that you use /dev/sdd1 as the source device (as opposed
to /dev/sdd). Secondly, make sure that neither device is mounted by
the file system or other wise is use before you call dmsetup.
Finally, I find it's often easier to use blockdev --getsize /dev/sdxx
to determine the size of the device (in sectors). It is important to
note the both block size and cache size most be powers of 2 and you
must leave space at the end of the device for the meta data. Good
luck, let me know if you run into more problems.
-Doug
On Mar 24, 2012 1:28 AM, "sandrain"
<reply+i-3790568-16b7b8613f22bb8...@reply.github.com>
wrote:
I just realized upon talking with my colleagues, that you are using
version 3.0.8. The actual problem you are experiencing is because
3.0.8 is only able to handle associativity values of 1. Unless you
intend on booting multiple virtual machines through the same cache
device/partition or as LVs, I would suggest you use version 3.0. If
you do want to cache multiple virtual machines at once or if you want
to cache a virtual disk that has been stored as an LV, then you must
use 3.0.8 with associativity value "1". Associativity is the second
to last number; you had previously set it to 1024.
Sorry for the confusion,
Doug