qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] question about qemu disk cache mode
@ 2013-09-04  3:47 xuanmao_001
  2013-09-04  8:00 ` Kevin Wolf
  2013-09-04 10:03 ` Stefan Hajnoczi
  0 siblings, 2 replies; 6+ messages in thread
From: xuanmao_001 @ 2013-09-04  3:47 UTC (permalink / raw)
  To: qemu-devel, qemu-discuss; +Cc: Kevin Wolf

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

Dear qemuers:

my qemu-kvm version is 1.0.1
I would like to figure out the qemu disk cache mode. I have visited the qemu-options.hx
there is two cache that I didn't understand: the host cache page and the qemu disk write cache.

Is "host page cache" only used for read. and "qemu disk write cache" used for writing.

which cache the data reached first? host page cache or qemu disk write cache?




xuanmao_001

[-- Attachment #2: Type: text/html, Size: 1263 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] question about qemu disk cache mode
  2013-09-04  3:47 [Qemu-devel] question about qemu disk cache mode xuanmao_001
@ 2013-09-04  8:00 ` Kevin Wolf
  2013-09-04  9:07   ` xuanmao_001
  2013-09-04 10:03 ` Stefan Hajnoczi
  1 sibling, 1 reply; 6+ messages in thread
From: Kevin Wolf @ 2013-09-04  8:00 UTC (permalink / raw)
  To: xuanmao_001; +Cc: qemu-devel, qemu-discuss

Am 04.09.2013 um 05:47 hat xuanmao_001 geschrieben:
> Dear qemuers:
>  
> my qemu-kvm version is 1.0.1
> I would like to figure out the qemu disk cache mode. I have visited the
> qemu-options.hx
> there is two cache that I didn't understand: the host cache page and the qemu
> disk write cache.
>  
> Is "host page cache" only used for read. and "qemu disk write cache" used for
> writing.
>  
> which cache the data reached first? host page cache or qemu disk write cache?

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=none/directsync in
qemu). None of this is implemented in or specific to qemu.

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.

Hope this helps.

Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] question about qemu disk cache mode
  2013-09-04  8:00 ` Kevin Wolf
@ 2013-09-04  9:07   ` xuanmao_001
  2013-09-04  9:45     ` Kevin Wolf
  0 siblings, 1 reply; 6+ messages in thread
From: xuanmao_001 @ 2013-09-04  9:07 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, qemu-discuss

[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]

I understand the physical disk cache and host page cache.

I want to the difference between guest disk write cache and host page cache that described with "Caching modes in Qemu" in
https://events.linuxfoundation.org/slides/2011/linuxcon-japan/lcj2011_hajnoczi.pdf


give me some more information please, thanks.




xuanmao_001

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:
>  
> my qemu-kvm version is 1.0.1
> I would like to figure out the qemu disk cache mode. I have visited the
> qemu-options.hx
> there is two cache that I didn't understand: the host cache page and the qemu
> disk write cache.
>  
> Is "host page cache" only used for read. and "qemu disk write cache" used for
> writing.
>  
> which cache the data reached first? host page cache or qemu disk write cache?

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=none/directsync in
qemu). None of this is implemented in or specific to qemu.

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.

Hope this helps.

Kevin

[-- Attachment #2: Type: text/html, Size: 5295 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] question about qemu disk cache mode
  2013-09-04  9:07   ` xuanmao_001
@ 2013-09-04  9:45     ` Kevin Wolf
  2013-09-04 10:18       ` xuanmao_001
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Wolf @ 2013-09-04  9:45 UTC (permalink / raw)
  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.
>  
> I want to the difference between guest disk write cache and host page cache
> that described with "Caching modes in Qemu" in
> 
> https://events.linuxfoundation.org/slides/2011/linuxcon-japan/lcj2011_hajnoczi.pdf
> 
>  
> 
>  
> 
> 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

>  
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> xuanmao_001
>  
> 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:
> >  
> > my qemu-kvm version is 1.0.1
> > I would like to figure out the qemu disk cache mode. I have visited the
> > qemu-options.hx
> > there is two cache that I didn't understand: the host cache page and the qemu
> > disk write cache.
> >  
> > Is "host page cache" only used for read. and "qemu disk write cache" used for
> > writing.
> >  
> > which cache the data reached first? host page cache or qemu disk write cache?
>  
> 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=none/directsync in
> qemu). None of this is implemented in or specific to qemu.
>  
> 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.
>  
> Hope this helps.
>  
> Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] question about qemu disk cache mode
  2013-09-04  3:47 [Qemu-devel] question about qemu disk cache mode xuanmao_001
  2013-09-04  8:00 ` Kevin Wolf
@ 2013-09-04 10:03 ` Stefan Hajnoczi
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2013-09-04 10:03 UTC (permalink / raw)
  To: xuanmao_001; +Cc: Kevin Wolf, qemu-devel, qemu-discuss

On Wed, Sep 04, 2013 at 11:47:04AM +0800, xuanmao_001 wrote:
> my qemu-kvm version is 1.0.1
> I would like to figure out the qemu disk cache mode. I have visited the qemu-options.hx
> there is two cache that I didn't understand: the host cache page and the qemu disk write cache.
> 
> Is "host page cache" only used for read. and "qemu disk write cache" used for writing.
> 
> which cache the data reached first? host page cache or qemu disk write cache?

The following slides might be helpful in explaining the caching modes:
https://events.linuxfoundation.org/slides/2011/linuxcon-japan/lcj2011_hajnoczi.pdf

Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] question about qemu disk cache mode
  2013-09-04  9:45     ` Kevin Wolf
@ 2013-09-04 10:18       ` xuanmao_001
  0 siblings, 0 replies; 6+ messages in thread
From: xuanmao_001 @ 2013-09-04 10:18 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, qemu-discuss

[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]

so, the guest disk write cache just only for none and writeback cache mode?
the cache allocate on host for disk file image by qemu?




xuanmao_001

From: Kevin Wolf
Date: 2013-09-04 17:45
To: xuanmao_001
CC: qemu-devel; qemu-discuss
Subject: Re: Re: question about qemu disk cache mode
Am 04.09.2013 um 11:07 hat xuanmao_001 geschrieben:
> I understand the physical disk cache and host page cache.
>  
> I want to the difference between guest disk write cache and host page cache
> that described with "Caching modes in Qemu" in
> 
> https://events.linuxfoundation.org/slides/2011/linuxcon-japan/lcj2011_hajnoczi.pdf
> 
>  
> 
>  
> 
> 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

>  
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> xuanmao_001
>  
> 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:
> >  
> > my qemu-kvm version is 1.0.1
> > I would like to figure out the qemu disk cache mode. I have visited the
> > qemu-options.hx
> > there is two cache that I didn't understand: the host cache page and the qemu
> > disk write cache.
> >  
> > Is "host page cache" only used for read. and "qemu disk write cache" used for
> > writing.
> >  
> > which cache the data reached first? host page cache or qemu disk write cache?
>  
> 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=none/directsync in
> qemu). None of this is implemented in or specific to qemu.
>  
> 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.
>  
> Hope this helps.
>  
> Kevin

[-- Attachment #2: Type: text/html, Size: 6461 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-04 10:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-04  3:47 [Qemu-devel] question about qemu disk cache mode xuanmao_001
2013-09-04  8:00 ` Kevin Wolf
2013-09-04  9:07   ` xuanmao_001
2013-09-04  9:45     ` Kevin Wolf
2013-09-04 10:18       ` xuanmao_001
2013-09-04 10:03 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).