[writeboost] add plog_buf_cachep to allocate aligned kmem buffer

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] use vmalloc-ed buffer to clear plog

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] alloc rambuf from rambuf_cachep in apply_valid_segments

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] rename plog_buf -> plog_seg_buf in flush_plog

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] add plog_seg_buf_cachep

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
Merge pull request #10 from akiradeveloper/feature/fix-plog-buf-align

Feature/fix plog buf align
[writeboost] Redesign writeback structure

Migrate daemon is responsible to migrate segments on the cache device
the backing device.
The migration is segment-by-segment basis. It first determines which
segments to migrate and then migrates them all in sorted and batched
manner.

This patch defines struct migrate_segment to clearly show this algorithm
in the code, which improves readability.

Also, using KMEM buffers (alloced from aligned slab) instead of a VMA buffer
removes the limit of the number of segments to migrate. If we use even
better RAID-ed backing device instead of a single HDD it is capable of
processing thousand of migrate IOs which needs more memory space than
vmallac can allocate.

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] fix mixed declarations and code in apply_valid_segments

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] refactor: padding in plog_meta_device

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] explicit set force_drop true

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
Merge pull request #11 from akiradeveloper/feature/redesign-writeback-struct-v3

Feature/redesign writeback struct v3
[writeboost] Comments start from a capitalized letter

Other targets follows the rule that the comments start from
a capitalized letter. Writeboost should follow, too.

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] purge wbdebug macro

This macro is not useful now.
Use tracing tool (e.g. systemtap) instead.

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] Remove DMINFO in do_check_buffer_alignment()

This is only a debug code.
So, remove

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
[writeboost] redesign error messages

Do like other targets do.

- dm-cache and dm-thin uses __func__ to identify the called routine
  So, using this is OK. <funcname>: ... is their way of formatting.
- Should be capitalized as comments.
- If the routine returned error is known its name then embed the name
  into the message. Other targets do so and actually helps grep.

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
Merge pull request #12 from akiradeveloper/feature/cleanup

Feature/cleanup