From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VH9eN-0003lU-QG for qemu-devel@nongnu.org; Wed, 04 Sep 2013 05:45:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VH9eI-0003aJ-OS for qemu-devel@nongnu.org; Wed, 04 Sep 2013 05:45:23 -0400 Date: Wed, 4 Sep 2013 11:45:17 +0200 From: Kevin Wolf Message-ID: <20130904094517.GC3562@dhcp-200-207.str.redhat.com> References: <2013090411470490667813@163.com> <20130904080040.GA3562@dhcp-200-207.str.redhat.com> <2013090417074860959027@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2013090417074860959027@163.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] question about qemu disk cache mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xuanmao_001 Cc: qemu-devel , qemu-discuss Am 04.09.2013 um 11:07 hat xuanmao_001 geschrieben: > I understand the physical disk cache and host page cache. > =20 > I want to the difference between guest disk write cache and host page c= ache > that described with "Caching modes in Qemu" in >=20 > https://events.linuxfoundation.org/slides/2011/linuxcon-japan/lcj2011_h= ajnoczi.pdf >=20 > =20 >=20 > =20 >=20 > give me some more information please, thanks. It simply describes whether the guest will see a volatile write cache. This is the case if any writeback cache is involved in the stack, be it the host kernel page cache or the host disk write cache. Only if the whole stack uses writethrough caching, the guest won't see a volatile write cache. Kevin > =20 > =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81= =E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2= =94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94= =81=E2=94=81=E2=94=81=E2=94=81=E2=94=81 > xuanmao_001 > =20 > From: Kevin Wolf > Date: 2013-09-04 16:00 > To: xuanmao_001 > CC: qemu-devel; qemu-discuss > Subject: Re: question about qemu disk cache mode > Am 04.09.2013 um 05:47 hat xuanmao_001 geschrieben: > > Dear qemuers: > > =20 > > my qemu-kvm version is 1.0.1 > > I would like to figure out the qemu disk cache mode. I have visited t= he > > qemu-options.hx > > there is two cache that I didn't understand: the host cache page and = the qemu > > disk write cache. > > =20 > > Is "host page cache" only used for read. and "qemu disk write cache" = used for > > writing. > > =20 > > which cache the data reached first? host page cache or qemu disk writ= e cache? > =20 > You're probably misunderstanding the latter, I assume that what you've > read about is the "disk cache", not a "qemu disk cache". This is the > cache on your hardware, the physical hard disk. The host page cache is > the caching that the Linux kernel does for every file (unless it's > bypassed with O_DIRECT, with is exposed as cache=3Dnone/directsync in > qemu). None of this is implemented in or specific to qemu. > =20 > When you write data, it reaches the page cache in the kernel first (if > it is used at all), and then the cache on the hard disk. > =20 > Hope this helps. > =20 > Kevin