[Sheepdog] [PATCH v2] add object cache for sheep

Liu Yuan namei.unix at gmail.com
Mon Mar 12 13:10:12 CET 2012

v1 -> v2:
 - free entry when add_to_dirty_rb_and_list() fails.
 - use mutex instead of spin lock.

    Object cache caches data and vdi objects on the local node. It is at
higher level than backend store. This extra cache layer translate gateway
requests into local requests, largely reducing the network traffic and highly
improving the IO performance.
    Dirty objects will be flushed to cluster storage by 'sync' request from
guest OS.

    The initial version concentrate on the simplicity. Its design is straightforward
just add one layer in front of the backend store. So the gateway requests (from Guest)

old path: IO req -> backend store
new path: IO req -> object cache -> backend store

    Later we might consider other features, for e.g., cache quota for different VDIs.


Liu Yuan (7):
      sheep: drive object cache to work
      sheep: add red black tree library
      sheep: object cache proper
      sheep: teach sheep to use object cache
      sheep: add flush_vdi operation
      sheep: let object cache better interact with recovery logic
      collie: flush the vdi before searching the object

 collie/vdi.c             |   19 ++
 include/rbtree.h         |   80 ++++++++
 include/sheepdog_proto.h |    1 +
 lib/Makefile.am          |    2 +-
 lib/rbtree.c             |  451 +++++++++++++++++++++++++++++++++++++++++++
 sheep/Makefile.am        |    2 +-
 sheep/group.c            |   13 ++-
 sheep/object_cache.c     |  482 ++++++++++++++++++++++++++++++++++++++++++++++
 sheep/ops.c              |    5 +
 sheep/sheep_priv.h       |   38 ++++
 sheep/store.c            |   56 +++++-
 11 files changed, 1140 insertions(+), 9 deletions(-)

More information about the sheepdog mailing list