jthornber / device-mapper-test-suite

Test suite for device mapper targets
GNU General Public License v3.0
23 stars 20 forks source link

Create dm-cache and test failed #61

Closed pahome closed 4 years ago

pahome commented 4 years ago

I create dm-cache with SSD RAID0(/dev/md1) and HDD(/dev/sdd)

sudo dmsetup create ssd-metadata --table '0 122657 linear /dev/md1 0'
sudo dd if=/dev/zero of=/dev/mapper/ssd-metadata
sudo dmsetup create ssd-blocks --table '0 1875282143 linear /dev/md1 122657'
sudo dmsetup create home-cached --table '0 1953525168 cache /dev/mapper/ssd-metadata /dev/mapper/ssd-blocks /dev/sdd 512 1 writeback default 0'

Then write new profile ssd in ~/.dmtest/config:

profile :ssd do
  metadata_dev '/dev/mapper/ssd-metadata'
  data_dev '/dev/mapper/home-cached'
end

And run rvmsudo dmtest run --suite cache --profile ssd -t FIOTests

But it shows all error:

Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. Run:

    export rvmsudo_secure_path=1

to avoid the warning, put it in shell initialization file to make it persistent.

In case there is no `secure_path` in `/etc/sudoers`. Run:

    export rvmsudo_secure_path=0

to avoid the warning, put it in shell initialization file to make it persistent.
Loaded suite cache
FIOTests
  fio_across_cache_size_mq...#<Test::Unit::Error:0x0000000001c1af60
 @exception=#<RuntimeError: out of free space>,
 @test_name="test_fio_across_cache_size_mq(FIOTests)">
FAIL
  fio_across_cache_size_smq...#<Test::Unit::Error:0x0000000001f971c0
 @exception=#<RuntimeError: out of free space>,
 @test_name="test_fio_across_cache_size_smq(FIOTests)">
FAIL
  fio_on_fast...#<Test::Unit::Error:0x0000000002034f38
 @exception=#<RuntimeError: out of free space>,
 @test_name="test_fio_on_fast(FIOTests)">
FAIL
  fio_on_regions...#<Test::Unit::Error:0x00000000027025b8
 @exception=#<RuntimeError: out of free space>,
 @test_name="test_fio_on_regions(FIOTests)">
FAIL
  fio_on_slow...#<Test::Unit::Error:0x00007fe3a8007ad8
 @exception=#<ArgumentError: wrong number of arguments (given 2, expected 3)>,
 @test_name="test_fio_on_slow(FIOTests)">
FAIL
  origin_same_size_as_ssd_mq...#<Test::Unit::Error:0x000000000276d700
 @exception=#<RuntimeError: out of free space>,
 @test_name="test_origin_same_size_as_ssd_mq(FIOTests)">
FAIL
  origin_same_size_as_ssd_smq...#<Test::Unit::Error:0x00000000027bfde8
 @exception=#<RuntimeError: out of free space>,
 @test_name="test_origin_same_size_as_ssd_smq(FIOTests)">
FAIL

Why it shows out of free space? and other errors? Is there anything wrong?

jthornber commented 4 years ago

dmtest sets up caches etc itself, just put the raw block devices in the config (or a slice of them).

The error you're getting is to do with sudo, nothing to do with dmtest.

pahome commented 4 years ago

@jthornber Excuse me, somethin weird still found.

I modified config to contain only raw device I'm sure /dev/sdb and /dev/sdc are all ssd.

profile :ssd do
  metadata_dev '/dev/sdb'
  data_dev '/dev/sdc'
end

default_profile :ssd

Then run a basic task with rvmsudo(failed without rvmsudo) rvmsudo dmtest run --suite cache --profile ssd -t BackgroundWritebackTests

It still got something wrong

Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. Run:

    export rvmsudo_secure_path=1

to avoid the warning, put it in shell initialization file to make it persistent.

In case there is no `secure_path` in `/etc/sudoers`. Run:

    export rvmsudo_secure_path=0

to avoid the warning, put it in shell initialization file to make it persistent.
Loaded suite cache
BackgroundWritebackTests
  cache_remains_clean_through_reload_mq_1...16357 dirty blocks
8586 dirty blocks
885 dirty blocks
0 dirty blocks
0 dirty blocks
No input files found for test-dev-184974
PASS
  cache_remains_clean_through_reload_mq_2...#<Test::Unit::Error:0x00007f8aa0005500
 @exception=
  #<ProcessControl::ExitError: command failed: cache_restore  --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-518937>,
 @test_name=
  "test_cache_remains_clean_through_reload_mq_2(BackgroundWritebackTests)">
FAIL
  cache_remains_clean_through_reload_smq_1...16362 dirty blocks
8893 dirty blocks
1324 dirty blocks
0 dirty blocks
0 dirty blocks
No input files found for test-dev-992634
PASS
  cache_remains_clean_through_reload_smq_2...#<Test::Unit::Error:0x00000000028a0cd0
 @exception=
  #<ProcessControl::ExitError: command failed: cache_restore  --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-378744>,
 @test_name=
  "test_cache_remains_clean_through_reload_smq_2(BackgroundWritebackTests)">
FAIL
  clean_a_cache_with_large_blocks...#<Test::Unit::Error:0x00000000029c7f28
 @exception=
  #<ProcessControl::ExitError: command failed: cache_restore  --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-205475>,
 @test_name="test_clean_a_cache_with_large_blocks(BackgroundWritebackTests)">
FAIL
  clean_data_never_gets_written_back_mq_1...No input files found for test-dev-623727
PASS
  clean_data_never_gets_written_back_mq_2...#<Test::Unit::Error:0x0000000002bd3178
 @exception=
  #<ProcessControl::ExitError: command failed: cache_restore  --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-997659>,
 @test_name=
  "test_clean_data_never_gets_written_back_mq_2(BackgroundWritebackTests)">
FAIL
...

I'm a newbie so don't know where to debug Could your teach me why this FAIL happened?

jthornber commented 4 years ago

Do you have cache_restore in your path?

On Thu, 28 May 2020 at 09:15, lampahome notifications@github.com wrote:

@jthornber https://github.com/jthornber Excuse me, somethin weird still found.

I modified config to contain only raw device I'm sure /dev/sdb and /dev/sdc are all ssd.

profile :ssd do metadata_dev '/dev/sdb' data_dev '/dev/sdc' end

default_profile :ssd

Then run a basic task with rvmsudo(failed without rvmsudo) rvmsudo dmtest run --suite cache --profile ssd -t BackgroundWritebackTests

It still got something wrong

Warning: can not check /etc/sudoers for secure_path, falling back to call via /usr/bin/env, this breaks rules from /etc/sudoers. Run:

export rvmsudo_secure_path=1

to avoid the warning, put it in shell initialization file to make it persistent.

In case there is no secure_path in /etc/sudoers. Run:

export rvmsudo_secure_path=0

to avoid the warning, put it in shell initialization file to make it persistent. Loaded suite cache BackgroundWritebackTests cache_remains_clean_through_reload_mq_1...16357 dirty blocks 8586 dirty blocks 885 dirty blocks 0 dirty blocks 0 dirty blocks No input files found for test-dev-184974 PASS cache_remains_clean_through_reload_mq_2...#<Test::Unit::Error:0x00007f8aa0005500 @exception=

<ProcessControl::ExitError: command failed: cache_restore --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-518937>,

@test_name= "test_cache_remains_clean_through_reload_mq_2(BackgroundWritebackTests)"> FAIL cache_remains_clean_through_reload_smq_1...16362 dirty blocks 8893 dirty blocks 1324 dirty blocks 0 dirty blocks 0 dirty blocks No input files found for test-dev-992634 PASS cache_remains_clean_through_reload_smq_2...#<Test::Unit::Error:0x00000000028a0cd0 @exception=

<ProcessControl::ExitError: command failed: cache_restore --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-378744>,

@test_name= "test_cache_remains_clean_through_reload_smq_2(BackgroundWritebackTests)"> FAIL clean_a_cache_with_large_blocks...#<Test::Unit::Error:0x00000000029c7f28 @exception=

<ProcessControl::ExitError: command failed: cache_restore --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-205475>,

@test_name="test_clean_a_cache_with_large_blocks(BackgroundWritebackTests)"> FAIL clean_data_never_gets_written_back_mq_1...No input files found for test-dev-623727 PASS clean_data_never_gets_written_back_mq_2...#<Test::Unit::Error:0x0000000002bd3178 @exception=

<ProcessControl::ExitError: command failed: cache_restore --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-997659>,

@test_name= "test_clean_data_never_gets_written_back_mq_2(BackgroundWritebackTests)"> FAIL ...

I'm a newbie so don't know where to debug Could your teach me why this FAIL happened?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635190754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ2DV3ZJXGAORG7QDB3RTYMQ7ANCNFSM4NMWSFQA .

pahome commented 4 years ago

Yes

Host:/home/git/device-mapper-test-suite$ which cache_restore 
/usr/sbin/cache_restore
Host:/home/git/device-mapper-test-suite$ ll /usr/sbin/cache_restore 
lrwxrwxrwx 1 root root 11  十  25  2015 /usr/sbin/cache_restore -> pdata_tools*
jthornber commented 4 years ago

Next thing to do is look at the log in ~/.dmtest/logs and see why cache_restore failed. You can also do this via your web browser using 'dmtest serve'.

On Thu, 28 May 2020 at 09:25, lampahome notifications@github.com wrote:

Yes

Host:/git/device-mapper-test-suite$ which cache_restore /usr/sbin/cache_restore Host:/git/device-mapper-test-suite$ ll /usr/sbin/cache_restore lrwxrwxrwx 1 root root 11 十 25 2015 /usr/sbin/cache_restore -> pdata_tools*

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635196130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ6FC7MZN3UJHFK62B3RTYNWTANCNFSM4NMWSFQA .

pahome commented 4 years ago

Found it

...
D, [2020-05-28T16:18:13.978003 #13488] DEBUG -- : executing: 'cache_restore  --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-513496'
D, [2020-05-28T16:18:13.980712 #13488] DEBUG -- : stderr:
    cache_restore: unrecognized option '--metadata-version'
    Usage: cache_restore [options]
    Options:
      {-h|--help}
      {-i|--input} <input xml file>
      {-o|--output} <output device or file>
      {-q|--quiet}
      {-V|--version}

      {--debug-override-metadata-version} <integer>
      {--omit-clean-shutdown}

Is that version too old? Mine OS is ubuntu 16.04

jthornber commented 4 years ago

cache_restore --version,

I'm running 0.8.5 here.

On Thu, 28 May 2020 at 09:32, lampahome notifications@github.com wrote:

Found it

... D, [2020-05-28T16:18:13.978003 #13488] DEBUG -- : executing: 'cache_restore --metadata-version 2 -i metadata.xml -o /dev/mapper/test-dev-513496' D, [2020-05-28T16:18:13.980712 #13488] DEBUG -- : stderr: cache_restore: unrecognized option '--metadata-version' Usage: cache_restore [options] Options: {-h|--help} {-i|--input} {-o|--output} {-q|--quiet} {-V|--version}

  {--debug-override-metadata-version} <integer>
  {--omit-clean-shutdown}

Is that version too old? Mine OS is ubuntu 16.04

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635199612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ5LNKAAZZPB4LECCATRTYOQBANCNFSM4NMWSFQA .

pahome commented 4 years ago
$ cache_restore --version
0.5.6

Do you build from its github directly?

jthornber commented 4 years ago

Yes

On Thu, 28 May 2020 at 09:35, lampahome notifications@github.com wrote:

$ cache_restore --version 0.5.6

Do you build from its github directly?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635201338, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ6WD243XJKAUFXY74LRTYO4DANCNFSM4NMWSFQA .

pahome commented 4 years ago

In cache suit BackgroundWritebackTests, some still failed

BackgroundWritebackTests
    cache_remains_clean_through_reload_mq_1    
    cache_remains_clean_through_reload_mq_2    
    cache_remains_clean_through_reload_smq_1    
    cache_remains_clean_through_reload_smq_2    
    clean_a_cache_with_large_blocks    
    clean_data_never_gets_written_back_mq_1    
    clean_data_never_gets_written_back_mq_2    
    clean_data_never_gets_written_back_smq_1    
    clean_data_never_gets_written_back_smq_2    
    dirty_data_always_gets_written_back_mq_1    FAIL
    dirty_data_always_gets_written_back_mq_2    FAIL
    dirty_data_always_gets_written_back_smq_1    FAIL
    dirty_data_always_gets_written_back_smq_2    FAIL

I take a look at dirty_data_always_gets_written_back_mq_1 log:

... ...
D, [2020-05-28T16:41:51.280358 #21050] DEBUG -- : stdout:
    0 937703088 cache 8 58/1024 128 16380/16384 17 29 0 0 8 4 0 1 writeback 2 migration_threshold 1024 mq 10 random_threshold 0 sequential_threshold 0 discard_promote_adjustment 0 read_promote_adjustment 0 write_promote_adjustment 0 rw -
D, [2020-05-28T16:41:51.281044 #21050] DEBUG -- : executing: 'dmsetup remove test-dev-539956'
D, [2020-05-28T16:41:51.366892 #21050] DEBUG -- : executing: 'cache_check /dev/mapper/test-dev-585676'
D, [2020-05-28T16:41:51.438179 #21050] DEBUG -- : stderr:
    examining superblock
    examining mapping array
    examining hint array
    examining discard bitset
D, [2020-05-28T16:41:51.637689 #21050] DEBUG -- : stdout:
    === dm-2 ===
      CPU  0:                   56 events,        3 KiB data
      CPU  1:                    0 events,        0 KiB data
      CPU  2:                16408 events,      770 KiB data
      CPU  3:                    0 events,        0 KiB data
      Total:                 16464 events (dropped 0),      772 KiB data
D, [2020-05-28T16:41:51.642712 #21050] DEBUG -- : executing: 'dmsetup remove test-dev-393569'
D, [2020-05-28T16:41:51.666299 #21050] DEBUG -- : executing: 'dmsetup remove test-dev-464559'
D, [2020-05-28T16:41:51.690019 #21050] DEBUG -- : executing: 'dmsetup remove test-dev-585676'
E, [2020-05-28T16:41:51.720470 #21050] ERROR -- : Failure:
test_dirty_data_always_gets_written_back_mq_1(BackgroundWritebackTests)
    [/usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/tests/cache/background_writeback_tests.rb:83:in `block in dirty_data_always_gets_written_back'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/ensure_elapsed.rb:13:in `ensure_elapsed_time'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/cache_stack.rb:75:in `block in activate_support_devs'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/ensure_elapsed.rb:13:in `ensure_elapsed_time'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/device-mapper/lexical_operators.rb:42:in `block in with_devs'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/prelude.rb:6:in `bracket'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/device-mapper/lexical_operators.rb:37:in `with_devs'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/cache_stack.rb:67:in `activate_support_devs'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/tests/cache/background_writeback_tests.rb:72:in `dirty_data_always_gets_written_back'
     /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/test-utils.rb:25:in `block (2 levels) in define_tests_across']:
<16384> expected but was
<0>.
I, [2020-05-28T16:41:51.720736 #21050]  INFO -- : Peak bufio allocation was 458752

I don't understand what it means

jthornber commented 4 years ago

It means an assertion has failed (expected 16384 but was 0). You'll have to look at background_writeback_tests.rb for more info.

What are you trying to do? These tests are for people developing device mapper targets (ie. kernel programmers).

On Thu, 28 May 2020 at 09:49, lampahome notifications@github.com wrote:

In cache suit BackgroundWritebackTests, some still failed

BackgroundWritebackTests cache_remains_clean_through_reload_mq_1 cache_remains_clean_through_reload_mq_2 cache_remains_clean_through_reload_smq_1 cache_remains_clean_through_reload_smq_2 clean_a_cache_with_large_blocks clean_data_never_gets_written_back_mq_1 clean_data_never_gets_written_back_mq_2 clean_data_never_gets_written_back_smq_1 clean_data_never_gets_written_back_smq_2 dirty_data_always_gets_written_back_mq_1 FAIL dirty_data_always_gets_written_back_mq_2 FAIL dirty_data_always_gets_written_back_smq_1 FAIL dirty_data_always_gets_written_back_smq_2 FAIL

I take a look at dirty_data_always_gets_written_back_mq_1 log:

... ... D, [2020-05-28T16:41:51.280358 #21050] DEBUG -- : stdout: 0 937703088 cache 8 58/1024 128 16380/16384 17 29 0 0 8 4 0 1 writeback 2 migration_threshold 1024 mq 10 random_threshold 0 sequential_threshold 0 discard_promote_adjustment 0 read_promote_adjustment 0 write_promote_adjustment 0 rw - D, [2020-05-28T16:41:51.281044 #21050] DEBUG -- : executing: 'dmsetup remove test-dev-539956' D, [2020-05-28T16:41:51.366892 #21050] DEBUG -- : executing: 'cache_check /dev/mapper/test-dev-585676' D, [2020-05-28T16:41:51.438179 #21050] DEBUG -- : stderr: examining superblock examining mapping array examining hint array examining discard bitset D, [2020-05-28T16:41:51.637689 #21050] DEBUG -- : stdout: === dm-2 === CPU 0: 56 events, 3 KiB data CPU 1: 0 events, 0 KiB data CPU 2: 16408 events, 770 KiB data CPU 3: 0 events, 0 KiB data Total: 16464 events (dropped 0), 772 KiB data D, [2020-05-28T16:41:51.642712 #21050] DEBUG -- : executing: 'dmsetup remove test-dev-393569' D, [2020-05-28T16:41:51.666299 #21050] DEBUG -- : executing: 'dmsetup remove test-dev-464559' D, [2020-05-28T16:41:51.690019 #21050] DEBUG -- : executing: 'dmsetup remove test-dev-585676' E, [2020-05-28T16:41:51.720470 #21050] ERROR -- : Failure: test_dirty_data_always_gets_written_back_mq_1(BackgroundWritebackTests) [/usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/tests/cache/background_writeback_tests.rb:83:in block in dirty_data_always_gets_written_back' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/ensure_elapsed.rb:13:inensure_elapsed_time' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/cache_stack.rb:75:in block in activate_support_devs' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/ensure_elapsed.rb:13:inensure_elapsed_time' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/device-mapper/lexical_operators.rb:42:in block in with_devs' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/prelude.rb:6:inbracket' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/device-mapper/lexical_operators.rb:37:in with_devs' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/cache_stack.rb:67:inactivate_support_devs' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/tests/cache/background_writeback_tests.rb:72:in dirty_data_always_gets_written_back' /usr/share/rvm/gems/ruby-2.5.3/gems/device_mapper_test_suite-0.0.1/lib/dmtest/test-utils.rb:25:inblock (2 levels) in define_tests_across']:

<16384> expected but was <0>. I, [2020-05-28T16:41:51.720736 #21050] INFO -- : Peak bufio allocation was 458752 I don't understand what it means — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or unsubscribe .
pahome commented 4 years ago

What are you trying to do?

I want to try my custom dm-cache driver, so want to find tool to test if driver works But now I only use dm-cache of upstream kernel 5.4(need to enable dm-cache) in Ubuntu16.04

Unfortunately, I'm not familiar with ruby

pahome commented 4 years ago

I checked background_writeback_tests.rb If fails here:

def dirty_data_always_gets_written_back(policy, metadata_version)
...
    traces, _ = blktrace(s.origin) do
    ...
    assert_equal(cache_size / block_size, filter_writes(traces[0]).size)
  end
end

My cache_size is 2097152, block_size is 128, so cache_size / block_size is 16384 Is that possible to modify that by arguments? or other ways? Or blktrace return wrong traces?

jthornber commented 4 years ago

Which kernel are you using?

On Thu, 28 May 2020 at 10:19, lampahome notifications@github.com wrote:

I checked background_writeback_tests.rb If fails here:

def dirty_data_always_gets_written_back(policy, metadata_version) ... assert_equal(cache_size / block_size, filter_writes(traces[0]).size) end end

My cache_size is 2097152, block_size is 128, so cache_size / block_size is 16384 Is that possible to modify that by arguments? or other ways?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635224173, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQZSP7Y4BCVAVB7BLADRTYUC7ANCNFSM4NMWSFQA .

pahome commented 4 years ago

Linux pahome-QW09 5.4.20+ 1 SMP Wed May 27 17:07:17 CST 2020 x86_64 x86_64 x86_64 GNU/Linux

And I also enable dm-cache, dm-verity, dm-dust when make menuconfig.

Can I know your kernel version? I wanna tried .

jthornber commented 4 years ago

ok, so not too old.

If you're doing kernel development I strongly recommend you do it within a virtual machine. That way you don't risk trashing your real machine.

Are you modifying my existing dm-cache, or writing a new policy for it, or writing something new from scratch?

On Thu, 28 May 2020 at 10:28, lampahome notifications@github.com wrote:

Linux pahome-QW09 5.4.20+ #1 https://github.com/jthornber/device-mapper-test-suite/issues/1 SMP Wed May 27 17:07:17 CST 2020 x86_64 x86_64 x86_64 GNU/Linux

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635228507, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ4LBL62K4TU4IGEOMTRTYVD5ANCNFSM4NMWSFQA .

pahome commented 4 years ago

Are you modifying my existing dm-cache, or writing a new policy for it, or writing something new from scratch?

No, I don't modified anything about kernel 5.4 and your code. Just enable dm-cache...etc and reboot. Then dmtest run --suite cache... like above mentioned.

jthornber commented 4 years ago

"I want to try my custom dm-cache driver" <- what did you mean by this then?

On Thu, 28 May 2020 at 10:35, lampahome notifications@github.com wrote:

Are you modifying my existing dm-cache, or writing a new policy for it, or writing something new from scratch?

No, I don't modified anything about kernel 5.4 and your code. Just enable dm-cache...etc and reboot. Then dmtest run --suite cache... like above mentioned.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635232013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ3PKOYC3IFBCEB4LJTRTYV57ANCNFSM4NMWSFQA .

pahome commented 4 years ago

"I want to try my custom dm-cache driver" <- what did you mean by this

In the future, I want to re-write dm-cache for my job. So I first use upstream dm-cache and test it by device-mapper-test-suite

BTW, I saw cache_size and block_size was defined by function, maybe that's why I always failed.

jthornber commented 4 years ago

How will your rewrite differ? Between dm-cache and dm-writecache I think we've got a really strong offering atm.

On Thu, 28 May 2020 at 10:40, lampahome notifications@github.com wrote:

"I want to try my custom dm-cache driver" <- what did you mean by this

In the future, I want to re-write dm-cache for my job. So I first use upstream dm-cache and test it by device-mapper-test-suite

BTW, I saw cache_size and block_size was defined by function, maybe that's why I always failed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635234747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ7EVCQ6UGM4X5YYITDRTYWSLANCNFSM4NMWSFQA .

pahome commented 4 years ago

The target of rewrite maybe combine flashcache and dm-cache So I don't know difference between dm-cache and dm-writecache And I have no idea to port rewrited dm-cache to upstream.

pahome commented 4 years ago

Is that bug?

In ./lib/dmtest/tests/cache/fio_tests.rb

def run_fio(dev, name, file_size) <- 3 arguments
    outfile = AP("fio-#{name}.out")
    size_in_meg = file_size / meg(1)
...
  def baseline(dev, name)
    sub_vol_size = meg(1024 + 128)

    vg = TinyVolumeManager::VM.new
    vg.add_allocation_volume(dev)
    vg.add_volume(linear_vol("vol", sub_vol_size))
    with_dev(vg.table("vol")) do |vol|
      run_fio(vol, name) <- 2 arguments
    end
  end

function arguments number different there

jthornber commented 4 years ago

yes, pass in sub_vol_size

On Thu, 28 May 2020 at 10:54, lampahome notifications@github.com wrote:

Is that bug?

In ./lib/dmtest/tests/cache/fio_tests.rb

def run_fio(dev, name, file_size) <- 3 arguments outfile = AP("fio-#{name}.out") size_in_meg = file_size / meg(1) ... def baseline(dev, name) sub_vol_size = meg(1024 + 128)

vg = TinyVolumeManager::VM.new vg.add_allocation_volume(dev) vg.add_volume(linear_vol("vol", sub_vol_size)) with_dev(vg.table("vol")) do |vol| run_fio(vol, name) <- 2 arguments end end

function arguments number different there

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635241267, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ52LI4PV62CPJNZM2LRTYYFXANCNFSM4NMWSFQA .

pahome commented 4 years ago

If I want to test dm-cache in kernel 5.4 What item should I test in cache suite?

BackgroundWritebackTests <-- passed
BurstyWriteTests
DTTests
DiscardTests
FIOTests <-- fail in fio_on_slow and fio_on_fast
GitExtractTests
IOUseTests
InvalidateCBlocksTests
LargeConfigTests
MetadataScalingTests
MetadataVersionTests
NeedsCheckTests
NoCleanShutdownTests
PassthroughTests
PolicySwitchTests
ResizeTests
SMQComparisonTests
SmallConfigTests
ToolsTests
WriteThroughTests
jthornber commented 4 years ago

I'd start with:

dmtest run --suite cache -t FIOTests -n fio_across_cache_size_smq

On Thu, 28 May 2020 at 11:21, lampahome notifications@github.com wrote:

If I want to test dm-cache in kernel 5.4 What item should I test in cache suite?

BackgroundWritebackTests <-- passed BurstyWriteTests DTTests DiscardTests FIOTests <-- fail in fio_on_slow and fio_on_fast GitExtractTests IOUseTests InvalidateCBlocksTests LargeConfigTests MetadataScalingTests MetadataVersionTests NeedsCheckTests NoCleanShutdownTests PassthroughTests PolicySwitchTests ResizeTests SMQComparisonTests SmallConfigTests ToolsTests WriteThroughTests

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635253622, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQZWWDDZLB44BEL46STRTY3JZANCNFSM4NMWSFQA .

pahome commented 4 years ago

It seems fio_on_slow and fio_on_fast of FIOTests will failed cuz of fallocate too much space

This grab the fio_on_slow.log from beginning to bug point:


D, [2020-05-28T18:26:46.799484 #30119] DEBUG -- : executing: 'blockdev --getsz /dev/sdc'
D, [2020-05-28T18:26:46.848807 #30119] DEBUG -- : stdout:
    937703088
D, [2020-05-28T18:26:46.849017 #30119] DEBUG -- : executing: 'dmsetup create test-dev-251980 --notable'
D, [2020-05-28T18:26:46.883216 #30119] DEBUG -- : writing table: <<table:0 2359296 linear /dev/sdc 0>>
D, [2020-05-28T18:26:46.883446 #30119] DEBUG -- : executing: 'dmsetup load test-dev-251980 /tmp/dm-table20200528-30119-ks48qz'
D, [2020-05-28T18:26:46.887144 #30119] DEBUG -- : executing: 'dmsetup resume test-dev-251980'
D, [2020-05-28T18:26:46.891093 #30119] DEBUG -- : executing: 'mkfs.ext4 -F -E lazy_itable_init=1,nodiscard /dev/mapper/test-dev-251980'
D, [2020-05-28T18:26:47.394981 #30119] DEBUG -- : stdout:
    Creating filesystem with 294912 4k blocks and 73728 inodes
    Filesystem UUID: 127858a3-167c-4f06-8da4-b14d440ba866
    Superblock backups stored on blocks:
        32768, 98304, 163840, 229376

    Allocating group tables: 0/9^H^H^H   ^H^H^Hdone
    Writing inode tables: 0/9^H^H^H   ^H^H^Hdone
    Creating journal (8192 blocks): done
    Writing superblocks and filesystem accounting information: 0/9^H^H^H   ^H^H^Hdone

D, [2020-05-28T18:26:47.395192 #30119] DEBUG -- : stderr:
    mke2fs 1.45.5 (07-Jan-2020)
D, [2020-05-28T18:26:47.395862 #30119] DEBUG -- : executing: 'mount /dev/mapper/test-dev-251980 ./fio_test '
D, [2020-05-28T18:26:47.547895 #30119] DEBUG -- : executing: 'fio /tmp/fio-job20200528-30119-s6xtpg --output=/home/pahome/git/device-mapper-test-suite/fio-slow.out'
D, [2020-05-28T18:26:51.666986 #30119] DEBUG -- : stderr:
    fio: posix_fallocate fails: No space left on device   <------Here
    fio: io_u error on file randrw.0.0: No space left on device: write offset=1201340416, buflen=65536
D, [2020-05-28T18:26:51.667228 #30119] DEBUG -- : command failed with 'pid 4671 exit 1': fio /tmp/fio-job20200528-30119-s6xtpg --output=/home/pahome/git/device-mapper-test-suite/fio-slow.out

Is there any way to avoid this? Like space maximum?

pahome commented 4 years ago

Sorry, where to download dt in Ubuntu? Looks like I download wrong binary It shows

Host:~/git/qnap_linux_5_4$ dt help
DITrack command-line client, version 0.8

General usage:
    dt <command> [<options>] [<args>]

Available commands:
    act
    cat
    commit, ci
    help
    list, ls
    new
    remove, rm
    status, st
    update, up

Type 'dt help <command>' for help on specific command.
jthornber commented 4 years ago

https://github.com/RobinTMiller/dt

On Thu, 28 May 2020 at 11:42, lampahome notifications@github.com wrote:

Sorry, where to download dt in Ubuntu? Looks like I download wrong binary It shows

Host:~/git/qnap_linux_5_4$ dt help DITrack command-line client, version 0.8

General usage: dt [] []

Available commands: act cat commit, ci help list, ls new remove, rm status, st update, up

Type 'dt help ' for help on specific command.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jthornber/device-mapper-test-suite/issues/61#issuecomment-635263006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOSQ5Z4564E62CSLCKSGTRTY52DANCNFSM4NMWSFQA .

pahome commented 4 years ago

Do you have any ideas about the fio_on_fast & fio_on_slow issues?

pahome commented 4 years ago

When I run task BurstyWriteTests in cache suite, it fails.

Take a look at one of the log smallfile_cache_mq_1.log:

D, [2020-05-29T09:54:31.981131 #26449] DEBUG -- : executing: 'mount -o nouuid /dev/mapper/test-dev-970212 ./smallfile-mount'
D, [2020-05-29T09:54:32.047034 #26449] DEBUG -- : executing: 'python ~/smallfile/smallfile_cli.py --top ./smallfile-mount --fsync Y --file-size-distribution exponential --hash-into-dirs Y --files-per-dir 30 --dirs-per-dir 5 --threads 4 --file-size 64 --operation create --files 10000'
D, [2020-05-29T09:54:32.401764 #26449] DEBUG -- : stderr:
    python: can't open file '/home/pahome/smallfile/smallfile_cli.py': [Errno 2] No such file or directory
D, [2020-05-29T09:54:32.401873 #26449] DEBUG -- : command failed with 'pid 26620 exit 2': python ~/smallfile/smallfile_cli.py --top ./smallfile-mount --fsync Y --file-size-distribution exponential --hash-into-dirs Y --files-per-dir 30 --dirs-per-dir 5 --threads 4 --file-size 64 --operation create --files 10000

Where to find the smallfile_cli.py?