[sheepdog] [PATCH 0/7] Introduce Sheepdog Block Device (SBD)

Liu Yuan namei.unix at gmail.com
Sat May 24 15:41:36 CEST 2014


This is similar to Ceph's RBD. The main motivation is to replace complex
and ineffecient middle ware (such as iscsi softwafe) with simple software stacks
to expose sheepdog storage as Linux block device interface, which means that we
can make use of page cache as a client cache for buffered read/write optionally
and behaves as a normal Linux block device(s) in your local file system.

I implement a high performance(hopefully) aio framework for sending/recving data
and compared with iscsi tgt or sheepfs, this kernel module should provide much
better performance because of shortest code path.

With single major allocation scheme, we support 31 partitions for a sheep block
device at most and 32768 devices can be attached to local fs for a single node.

TODO
- support cloned sheep vdi
- auto-reconncect to sheep daemon if connection is off/crashed
- better error handling
- block device multi-queue support for recent kernel
- live snapshot of sbd

You can access this patch set at origin/sbd.
 $ git pull;
 $ git checkout -b sbd origin/sbd

To complile:
 $ cd shepdog/sbd/;make
 $ insmod sbd.ko

Usage:

We control the device the same way as RBD.

# associate vdi 'test' to /dev/sbd0
$ echo 127.0.0.1 7000 test > /sys/bus/sbd/add

# remove the device sbd0
$ echo 0 > /sys/bus/sbd/remove

# list the mapped devices
$ cat /sys/buf/sbd/list

To get best of performance,

# echo 4096 > /sys/block/sbd0/queue/max_sectors_kb

Which means io scheduler will try its best to handle us 4MB request.

Liu Yuan (7):
  sheep: some macro preparation for sbd kernem modual
  sbd: introduce basic framework for Sheepdog Block Device
  sbd: implement write operation
  sbd: implement read operation
  sbd: add list interface to control file
  sbd: add support for single major allocation scheme
  sbd: some error handling refinements

 include/sheepdog_proto.h |  19 +-
 sbd/Kbuild               |   5 +
 sbd/Makefile             |   8 +
 sbd/sbd.h                | 136 ++++++++++
 sbd/sheep.c              | 650 +++++++++++++++++++++++++++++++++++++++++++++++
 sbd/sheep_block_device.c | 419 ++++++++++++++++++++++++++++++
 6 files changed, 1231 insertions(+), 6 deletions(-)
 create mode 100644 sbd/Kbuild
 create mode 100644 sbd/Makefile
 create mode 100644 sbd/sbd.h
 create mode 100644 sbd/sheep.c
 create mode 100644 sbd/sheep_block_device.c

-- 
1.8.1.2




More information about the sheepdog mailing list