On 06/29/2011 08:55 AM, Christoph Hellwig wrote:
On Wed, Jun 29, 2011 at 07:08:18AM -0500, Anthony Liguori wrote:
As long as we advertise wce and wce can be toggled from the guest, I don't
think the default is all that important. I think cache=on is the right
default for most common use cases.
What do you mean with cache=on?
Sorry, I meant having a new cache option (maybe diskcache). Semantics
would be:
diskcache=on,wce=on 0
diskcache=on,wce=off O_SYNC
diskcache=off,wce=on O_DIRECT
diskcache=off,wce=off O_DIRECT | O_SYNC
ignore_flush could be another option too.
We have
cache=[none,writeback,writethrough,unsafe]. As discussed about a dozen
times before these are an incomplete choice of the [odirect=on,off;
osync=on,off, ignore cache flushes=on,off] matrix.
Yup, I agree that we need to deprecate
cache=[none,writeback,writethrough,unsafe] and add more meaningful tunables.
Not using O_DIRECT when it is available is almost always the wrong choice.
It means an additional data copy, VM pressure and exercise of often suck
fsync/O_SYNC codepatheses, with only a benefit if you have multiple VMs
actually using the same dataset with the same COW backing image.
Can we set globals for -drive via -readconfig?
If so, we could defer the default value to a config file setting which I
think would be the best possible scenario.
I think developers usually want diskcache=on but I also agree that
usually in production, you want diskcache=off.
Regards,
Anthony Liguori