Re: [GIT PULL] Ceph updates for 3.1-rc1

From: Sage Weil
Date: Mon Aug 01 2011 - 00:49:41 EST


On Sun, 31 Jul 2011, Christoph Hellwig wrote:
> On Tue, Jul 26, 2011 at 01:36:37PM -0700, Sage Weil wrote:
> > Sage Weil (19):
> > ceph: add flags field to file_info
> > ceph: add F_SYNC file flag to force sync (non-O_DIRECT) io
>
> Can you document what the exact semantics of this flag are, and how
> they different from using O_SYNC/O_DSYNC.

I should document this... in the fs/ceph/ioctl.h? Not sure where this
normally goes.

The CEPH_F_SYNC flag forces synchronous reads/writes that bypass the page
cache. It's similar to O_DIRECT, but makes a copy of the data before
doing the IO and does not have the alignment restrictions.

The real value is that it forces us to take a code path that's hard to
trigger otherwise. When a single client writes to a file, we can do
buffered IO. Even with O_SYNC/D_SYNC this just causes a flush after every
write. When multiple clients open a file for read/write, though, ceph
bypasses the page cache and does synchronous IO to the server. It's
similar to the O_DIRECT path, but not quite, and doesn't get good test
coverage without an easy way to use it.

A ceph ioctl sets the CEPH_F_SYNC flag in the file private struct. It's
similar to the CEPH_F_LAZYIO ioctl, but with opposite results; that one
avoids sync io despite multi-client write sharing (for applications who
know what they're doing).

sage

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/