[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache |
Date: |
Fri, 24 Apr 2015 11:52:14 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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);
> memset(memptr, 0, 65536);
> }
64k alignment is too much, in practice you need 512b or 4k, which
probably wastes a lot less memory.
But I just looked at the qcow2 cache code and you're right anyway.
Allocating one big block instead of many small allocations in a loop
looks like a good idea either way.
Kevin
pgpcIHzFs9L1T.pgp
Description: PGP signature
- [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Alberto Garcia, 2015/04/21
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Stefan Hajnoczi, 2015/04/22
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Alberto Garcia, 2015/04/22
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Stefan Hajnoczi, 2015/04/23
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Alberto Garcia, 2015/04/23
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Stefan Hajnoczi, 2015/04/24
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Kevin Wolf, 2015/04/24
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache,
Kevin Wolf <=
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Alberto Garcia, 2015/04/24
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Stefan Hajnoczi, 2015/04/24
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Alberto Garcia, 2015/04/24
- Re: [Qemu-block] [PATCH] qcow2: do lazy allocation of the L2 cache, Kevin Wolf, 2015/04/24