qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] Disk integrity in QEMU


From: Anthony Liguori
Subject: Re: [Qemu-devel] [RFC] Disk integrity in QEMU
Date: Mon, 13 Oct 2008 11:58:27 -0500
User-agent: Thunderbird 2.0.0.17 (X11/20080925)

Laurent Vivier wrote:
Le jeudi 09 octobre 2008 à 12:00 -0500, Anthony Liguori a écrit :
[...]
So to summarize, I think we should enable O_DSYNC by default to
ensure that guest data integrity is not dependent on the host OS, and that practically speaking, cache=off is only useful for very specialized circumstances. Part of the patch I'll follow up with includes changes to the man page to document all of this for users.

perhaps I'm wrong but I think O_DSYNC (in fact O_SYNC for linux) will
impact host filesystem performance, at least with ext3, because the
synchronicity is done through the commit of the journal of the whole
filesystem:

Yes, but this is important because if the journal isn't committed, then it's possible that while the data would be on disk, the file system metadata is out of sync on disk which could result in the changes to the file being lost.

I think that you are in fact correct that the journal write is probably unnecessary overhead in a lot of scenarios but Ryan actually has some performance data that he should be posting soon that shows that in most circumstances, O_DSYNC does pretty well compared to O_DIRECT for write so I don't this is a practical concern.

Regards,

Anthony Liguori

see fs/ext3/file.c:ext3_file_write() (I've removed the comments here) :

...
        if (file->f_flags & O_SYNC) {
if (!ext3_should_journal_data(inode))
                        return ret;

                goto force_commit;
        }


        if (!IS_SYNC(inode))
                return ret;

force_commit:
        err = ext3_force_commit(inode->i_sb);
        if (err)
                return err;
        return ret;
}

Moreover, the real behavior depends on the type of the journaling system
you use...

Regards,
Laurent





reply via email to

[Prev in Thread] Current Thread [Next in Thread]