[sheepdog] [PATCH v1, RFC] sheep: writeback cache semantics in backend store

Liu Yuan namei.unix at gmail.com
Thu Aug 30 14:15:14 CEST 2012


On 08/29/2012 12:10 PM, MORITA Kazutaka wrote:
> At Wed, 29 Aug 2012 11:36:35 +0800,
> Liu Yuan wrote:
>>>
>>> Adding a 'writeback' option is a bit confusing.  Should we extend a
>>> '-w' option so that we can specify types of caches we want to enable?
>>>
>>
>> Basically this is a sync operation, as we don't want to confuse users by
>> yet another writeback semantic, I'd suggest term it as sync operation.
>> Then how about -w {wrtiethrough,writeback},{nosync}? First two used for
>> object cache, and nosync used for backend. nosync means don't use D_SYNC
>> flag for backend write. For e.g
>>  -w writeback,nosync means use object cache and no D_SYNC flag for backend
>>  -w nosync means no D_SYNC flag for backend
>>  -w writethough means use object cache but still use D_SYNC flag for
>> backend write
> 
> I guess what sheep should do is only to specify what kinds of cache to
> be turned on.  Whether using writeback or writethrough should be
> specified by a qemu command line, no?
>

I think QEMU flag to control cache is really human-unfriendly, I guess most users will
get confused at 'cache=' options.
 
> 'nosync' sounds dangerous though this patch provides right block
> device semantics.  I vote for adding this patch as another write cache
> because we can say that this patch uses a local disk cache on each
> storage node as a Sheepdog disk cache.  In addition, we can consider
> yet another write cache implementation in future (e.g. use page cache
> on storage nodes (not gateway) as a Sheepdog disk cache).
> 

If you find 'nosync' kind of dangerous, how about 'buffered' which means we use buffered write
for backend. Then the new look will be:

-w writeback,buffered means use object cache and buffered write for backend
-w buffered means buffered write only for backend
-w writethrough means use object cache writethrough mode
-w writethrough,buffered, means use object cache writethrough mode and buffered write for backend.

The benefit:
 1) we don't need to modify QEMU at all. 2) we can control cache mode at our own side and write it more
human friendly and easy to use.

Thanks,
Yuan



More information about the sheepdog mailing list