[sheepdog] [PATCH] disk cache: drop O_DSYNC only when O_DIRECT is set

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Oct 30 12:16:46 CET 2012


At Tue, 30 Oct 2012 18:30:37 +0800,
Liu Yuan wrote:
> 
> On 10/30/2012 08:49 AM, MORITA Kazutaka wrote:
> > At Thu, 25 Oct 2012 13:52:01 +0900,
> > MORITA Kazutaka wrote:
> >>
> >> To make sure that data is not cached by the host os, we cannot drop
> >> O_DSYNC when O_DIRECT is not set.
> >>
> 
> Why data are cached in page cache a problem? We do sync(2) it afterwards.

For users who run VMs on storage nodes, more memory should be used for
guest OSes.  It's inefficient to cache data in both host and guest
page caches.

> 
> We don't set O_DIRECT for inode object, so sync(2) won't flush it to
> disk safely?

O_DIRECT imposes alignment restrictions on both the file offset and
the buffer length, so we cannot use it for any files other than data
objects.

Thanks,

Kazutaka



More information about the sheepdog mailing list