[Sheepdog] [PATCH] object cache: enable direct IO for cache object

Liu Yuan namei.unix at gmail.com
Sun Apr 1 19:04:15 CEST 2012


On 04/01/2012 08:56 PM, MORITA Kazutaka wrote:
> At Sun,  1 Apr 2012 19:51:41 +0800, Liu Yuan wrote:
>> 
>> From: Liu Yuan <tailai.ly at taobao.com>
>> 
>> When sheep is launched with '-D' or '--directio' option, we will
>> use direct IO for cache object too.
> 
> If you don't want to use a page cache for sheepdog object caches,
> how about making O_DIRECT default?  I think you know, but O_DSYNC
> doesn't means that sheep doesn't use a page cache.
> 

Yes, but later I thought if it is better to let user choose whether
use page cache or not. And I notice that our backend store uses O_DSYNC
as default, so I use it too to follow the convention.

So the point is, is it good to use uniform IO flags for all the IO path
(since our sheep cluster appear as a whole to be working as virtual disk
for Guest)?
To be frankly speaking, I am uncertain of it.
>> 
>> Signed-off-by: Liu Yuan <tailai.ly at taobao.com> --- 
>> sheep/object_cache.c |   18 ++++++++++++------ sheep/store.c
>> |   28 +++++++--------------------- 2 files changed, 19
>> insertions(+), 27 deletions(-)
> 
> This patch uses (O_DIRECT|O_DSYNC) for data object cache I/Os. Is
> there any reason you want to add O_DSYNC to O_DIRECT?  As I said 
> before, we don't need to flush cache data to disks.
> 
> In addition, I'd like to remove a O_DSYNC flag from vdi object cache 
> I/Os.  It would boosts the performance of metadata updates.
> 
> So my suggestion is: - (O_DIRECT|O_RDWR) for data object cache I/Os -
> O_RDWR for vdi object cache I/Os
>

Looks sensible to me, if we can use different scheme for object cache and
backend store.

Thanks,
Yuan



More information about the sheepdog mailing list