On 01/09/2013 08:42 PM, Kevin Wolf wrote: > Am 09.01.2013 13:07, schrieb Liu Yuan: >> Besides performance, I think backward compatibility is more important: >> 1 if we run a old kernel host (quite possible for a long running >> server) which doesn't support WCE, then we will never have a chance to >> choose writethrough cache for guest OS against new QEMU (most users tend >> to update user space tools to exclude bugs) > > How does the host kernel even play a role in this context? >
Oops, my mind was broken. Okay, guest OS which doesn't support WCE can't change cache type as we discussed. >> 2 The upper layer software which relies on the 'cache=xxx' to choose >> cache mode will fail its assumption against new QEMU. > > Which assumptions do you mean? As far as I can say the behaviour hasn't > changed, except possibly for the performance. > When users set 'cache=writethrough' to export only a writethrough cache to Guest, but with new QEMU, it will actually get a writeback cache as default. >> We can see that the writeback behavior for Guest-WCE toggling is the >> same as expected. The difference is that if we set cache=writethrough, >> guest can't change it via WCE toggling. > > Then you need to make sure to communicate this to the guest. I'm not > convinced that adding extra logic to each device for this is a good idea. > We don't need to communicate to the guest. I think 'cache=xxx' means what kind of cache the users *expect* to export to Guest OS. So if cache=writethrough set, Guest OS couldn't turn it to writeback cache magically. This is like I bought a disk with 'writethrough' cache built-in, I didn't expect that it turned to be a disk with writeback cache under the hood which could possible lose data when power outage happened. So Guest-WCE only works when users provide us a writeback capable disk. Thanks, Yuan