Git Product home page Git Product logo

dm-writeboost-tools's Introduction

dm-writeboost-tools

Join the chat at https://gitter.im/akiradeveloper/dm-writeboost-tools

Commandset to help users of dm-writeboost to analyze and report bugs. Written in Rust.

Install

Rustup is the best way to install Rust toolset.

https://github.com/rust-lang-nursery/rustup.rs

Then cargo install to install the commands.

Video

https://www.youtube.com/watch?v=QAXbmr2Rf30

Commands (Lexicographical order)

wbcheck

Check if the log was written successfully.

  • wbcheck /dev/cache 1 checks the segment ID 1. Returns 0 on success.

wbcreate

Create a WB device (wrapping dmsetup create)

  • wbcreate wbdev /dev/backing /dev/cache --reformat creates a WB device with reformatting
  • wbcreate wbdev /dev/backing /dev/cache --reformat --read_cache_threshold=4 --writeback_threshold=70 creates a WB device with some settings

wbdump

Dump the data blocks corresponding to the specified metablock ID.

  • wbdump /dev/cache 126 dumps the data block of metablock index 126

wbmeta

Look into the metadata in the cache device.

  • wbmeta /dev/cache 0 dumps the superblock metadata (ID 0 is special)
  • wbmeta /dev/cache 1 dumps the metadata of segment ID 1

wbremove

Remove a WB device

  • wbremove wbdev removes a WB device after flushing data in RAM buffer and then writing back all cache blocks. This is the way Dmirty Smirnov's writeboost script suggests. (Recommended)
  • wbremove wbdev --nowriteback remove a WB device without writing back all cache blocks.

wbstatus

Pretty-print the status line.

  • dmsetup status wbdev | wbstatus

Author

Akira Hayakawa ([email protected])

dm-writeboost-tools's People

Contributors

akiradeveloper avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dm-writeboost-tools's Issues

Sub command style

Now this project compiles several binaries but providing them as sub commands is the modern way.

The command name wb may be conflicted with others because it is used in many contexts like "write back" or "write buffer". So the command name should be something like wbtools.

However, the downside of this change will be documents, demos and packages will be all updated. What should I do.

wbcheck -a

wbcheck -a checks all segments in the caching device

Interpreting stats

Hi again!
I would like to ask what write=1 & hit=1 means?
Example:
cursor pos = 52040677
# of cache blocks = 91033346
# of segments = 716798
current id = 1126568
last flushed id = 1126567
last writeback id = 487778
# of dirty cache blocks = 66562932
# of partial flushes = 38108
write? hit? on_buffer? fullsize?
0 0 0 0 1
0 0 0 1 205034196
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 1681415
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 128200323
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 498264
1 1 1 0 0
1 1 1 1 67

What line 1 1 0 1 498264 means?

tests in docker and Github Actions

Since Rust is evolving the source code should be changed accordingly. Basic regression test is ok but should be written and environment should be built in docker.

Handle 4kn devices?

akiradeveloper/dm-writeboost#176

I think this code should be fixed too? But user land may submits 512B by RMW manner that results in submitting 4KB request in kernel. I will set the status to bug when reported.

 if id == 0 { // superblock
        let mut buf = [0;512];
        let mut f = File::open(&devname).unwrap();
        f.read(&mut buf).unwrap();
        let sup_header = lib::SuperBlockHeader::from_buf(&buf);

        let s = if sup_header.magic == 0x57427374 {
            "formatted"
        } else {
            "unformatted"
        };

        println!("[superblock header]");
        println!("magic = {} ({})", sup_header.magic, s);

        f.seek(SeekFrom::Start((1u64 << 20) - 512)).unwrap();
        f.read(&mut buf).unwrap();
        let sup_record = lib::SuperBlockRecord::from_buf(&buf);

        println!("[superblock record]");
        println!("last writeback id = {}", sup_record.last_writeback_segment_id);

wbstatus: validation

typical mistake should be avoided. if nr_caches isn't a number but "writeboost" it should be cautioned as error. This occurs when user input the output of dmsetup status instead of dmsetup status wbdev

command line parser: use structopt style parsing with clap 3.0

clap 3.0 starts to provide with the structopt like parsing.

The first example shows the simplest way to use clap, by defining a struct. If you're familiar with the structopt crate you're in luck, it's the same! (In fact it's the exact same code running under the covers!)

In case the old style parsing is deprecated, better to switch to the new style or use structopt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.