Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-05-08 Thread Alberto Garcia
On Fri 08 May 2015 11:47:00 AM CEST, Kevin Wolf wrote: >> There's also the problem that with a single chunk of memory for all >> cache tables it's not so easy to free individual entries. > > That's one of the reasons why I suggested to fix the problem by using > mmap() for the individual entries r

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-05-08 Thread Kevin Wolf
Am 08.05.2015 um 11:00 hat Alberto Garcia geschrieben: > On Fri 24 Apr 2015 03:04:06 PM CEST, Kevin Wolf wrote: > > >> >> I think it would be nice to have a way to free unused cache > >> >> entries after a while. > >> > > >> > Do you think mmap plus a periodic timer would work? > >> > > >> > I'm

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-05-08 Thread Alberto Garcia
On Fri 24 Apr 2015 03:04:06 PM CEST, Kevin Wolf wrote: >> >> I think it would be nice to have a way to free unused cache >> >> entries after a while. >> > >> > Do you think mmap plus a periodic timer would work? >> > >> > I'm hesitant about changes like this because they make QEMU more >> > compl

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Kevin Wolf
Am 24.04.2015 um 14:50 hat Alberto Garcia geschrieben: > On Fri 24 Apr 2015 02:37:21 PM CEST, Stefan Hajnoczi wrote: > > >> I think it would be nice to have a way to free unused cache entries > >> after a while. > > > > Do you think mmap plus a periodic timer would work? > > > > I'm hesitant about

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Alberto Garcia
On Fri 24 Apr 2015 02:37:21 PM CEST, Stefan Hajnoczi wrote: >> I think it would be nice to have a way to free unused cache entries >> after a while. > > Do you think mmap plus a periodic timer would work? > > I'm hesitant about changes like this because they make QEMU more > complex, slow down the

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Stefan Hajnoczi
On Fri, Apr 24, 2015 at 12:10 PM, Alberto Garcia wrote: > On Fri 24 Apr 2015 11:52:14 AM CEST, Kevin Wolf wrote: > >>> The posix_memalign() call wastes memory. I compared: >>> >>> posix_memalign(&memptr, 65536, 2560 * 65536); >>> memset(memptr, 0, 2560 * 65536); >>> >>> with: >>> >>> for (

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Alberto Garcia
On Fri 24 Apr 2015 11:52:14 AM CEST, Kevin Wolf wrote: >> The posix_memalign() call wastes memory. I compared: >> >> posix_memalign(&memptr, 65536, 2560 * 65536); >> memset(memptr, 0, 2560 * 65536); >> >> with: >> >> for (i = 0; i < 2560; i++) { >> posix_memalign(&memptr, 65536, 6

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Kevin Wolf
Am 24.04.2015 um 11:26 hat Stefan Hajnoczi geschrieben: > The posix_memalign() call wastes memory. I compared: > > posix_memalign(&memptr, 65536, 2560 * 65536); > memset(memptr, 0, 2560 * 65536); > > with: > > for (i = 0; i < 2560; i++) { > posix_memalign(&memptr, 65536, 65536); >

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Kevin Wolf
Am 24.04.2015 um 11:26 hat Stefan Hajnoczi geschrieben: > On Thu, Apr 23, 2015 at 01:50:28PM +0200, Alberto Garcia wrote: > > On Thu 23 Apr 2015 12:15:04 PM CEST, Stefan Hajnoczi wrote: > > > > >> For a cache size of 128MB, the PSS is actually ~10MB larger without > > >> the patch, which seems to

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-24 Thread Stefan Hajnoczi
On Thu, Apr 23, 2015 at 01:50:28PM +0200, Alberto Garcia wrote: > On Thu 23 Apr 2015 12:15:04 PM CEST, Stefan Hajnoczi wrote: > > >> For a cache size of 128MB, the PSS is actually ~10MB larger without > >> the patch, which seems to come from posix_memalign(). > > > > Do you mean RSS or are you usi

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-23 Thread Alberto Garcia
On Thu 23 Apr 2015 12:15:04 PM CEST, Stefan Hajnoczi wrote: >> For a cache size of 128MB, the PSS is actually ~10MB larger without >> the patch, which seems to come from posix_memalign(). > > Do you mean RSS or are you using a tool that reports a "PSS" number > that I don't know about? > > We shou

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-23 Thread Stefan Hajnoczi
On Wed, Apr 22, 2015 at 04:37:15PM +0200, Alberto Garcia wrote: > On Wed 22 Apr 2015 12:26:02 PM CEST, Stefan Hajnoczi wrote: > > >> Large disk images need large L2 caches in order to maximize their I/O > >> performance. However setting a correct size for the cache is not > >> necessarily easy sin

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-22 Thread Alberto Garcia
On Wed 22 Apr 2015 12:26:02 PM CEST, Stefan Hajnoczi wrote: >> Large disk images need large L2 caches in order to maximize their I/O >> performance. However setting a correct size for the cache is not >> necessarily easy since apart from the image size, it also depends on >> other factors like its

Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-22 Thread Stefan Hajnoczi
On Tue, Apr 21, 2015 at 06:20:39PM +0300, Alberto Garcia wrote: > Large disk images need large L2 caches in order to maximize their > I/O performance. However setting a correct size for the cache is not > necessarily easy since apart from the image size, it also depends > on other factors like its

[Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache

2015-04-21 Thread Alberto Garcia
Large disk images need large L2 caches in order to maximize their I/O performance. However setting a correct size for the cache is not necessarily easy since apart from the image size, it also depends on other factors like its usage patterns or whether it's part of a backing chain. In order to be