Received: from eggs.gnu.org ([2001:4830:134:3::10]:36367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq2QD-0000GC-7Z for qemu-devel@nongnu.org; Wed, 06 May 2015 12:43:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yq2Q5-0005JO-UI for qemu-devel@nongnu.org; Wed, 06 May 2015 12:43:45 -0400 Date: Wed, 6 May 2015 17:43:34 +0100 From: Stefan Hajnoczi Message-ID: <20150506164334.GH2386@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J/zg8ciPNcraoWb6" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 0/6] qcow2 L2/refcount cache improvements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org --J/zg8ciPNcraoWb6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 30, 2015 at 01:11:39PM +0300, Alberto Garcia wrote: > Here are some improvements to the qcow2 L2/refcount cache code. >=20 > The first one is that all cache tables are now allocated using a > single memory block, as we discussed last week. >=20 > Apart from a more efficient use of memory, this allows some additional > optimizations so I took the chance to make other changes. >=20 > - qcow2_cache_put() and qcow2_cache_entry_mark_dirty() are now O(1) > - The eviction algorithm is now LRU. The previous one only works well > with very small cache sizes. > - qcow2_cache_find_entry_to_replace() is no longer necessary. > - Lookups are faster now. >=20 > In my tests with a preallocated 128MB L2 cache in an empty drive the > new code is ~13% faster than the previous one (~43% if compiled > without optimizations). This is a best-case scenario, if the cache is > smaller or the drive is full of data the improvements are not so > visible, but I believe the code is simpler now so I hope you find the > changes worthwhile. Overall I'm happy with this approach. Looking forward to the next revision. Stefan --J/zg8ciPNcraoWb6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVSkS2AAoJEJykq7OBq3PIavMH/0abT7DizvGrZsDFsq3tsu4k Lx27EvEwBl6G2KGVoNGAYRZMi+PPMinCXmpgGJb8JIRgDY1wwgNByVCYvb0SkzJK 5dw68xRvKfMy4fDyicuU5xGBB29zjL23+bEbcpYO86Evv5paI978knJuJbnCT7hJ zEBKW7yrUupUNbuEolJOnoJZR9o0Un6ypaKoMzYxVAsMyaEMOpCb/nKutfistrWD Jh5Nund60U4S5zarjOEm2Gi4/wV23ghg7zUFtzrgL1ySxQIY+RTw6r3FOLYS5xfX WPS6z2OyK2YHN1jjfwM9BHucR+XBygyMYMt7Z81RhwsTx6KgOnO0pNj5N5ZMOtE= =e1OD -----END PGP SIGNATURE----- --J/zg8ciPNcraoWb6--