From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIrU-0007s2-IB for qemu-devel@nongnu.org; Thu, 07 May 2015 06:17:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqIrQ-0004gP-J1 for qemu-devel@nongnu.org; Thu, 07 May 2015 06:17:00 -0400 Date: Thu, 7 May 2015 11:16:53 +0100 From: Stefan Hajnoczi Message-ID: <20150507101653.GG13985@stefanha-thinkpad.redhat.com> References: <97f3d8a1ff7cbb2922a1d1c2007d7ccf44859294.1430919406.git.berto@igalia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oOB74oR0WcNeq9Zb" Content-Disposition: inline In-Reply-To: <97f3d8a1ff7cbb2922a1d1c2007d7ccf44859294.1430919406.git.berto@igalia.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 3/7] qcow2: use an LRU algorithm to replace entries from the L2 cache 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 --oOB74oR0WcNeq9Zb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 06, 2015 at 04:39:27PM +0300, Alberto Garcia wrote: > The current algorithm to evict entries from the cache gives always > preference to those in the lowest positions. As the size of the cache > increases, the chances of the later elements of being removed decrease > exponentially. >=20 > In a scenario with random I/O and lots of cache misses, entries in > positions 8 and higher are rarely (if ever) evicted. This can be seen > even with the default cache size, but with larger caches the problem > becomes more obvious. >=20 > Using an LRU algorithm makes the chances of being removed from the > cache independent from the position. >=20 > Signed-off-by: Alberto Garcia > --- > block/qcow2-cache.c | 31 +++++++++++++++---------------- > 1 file changed, 15 insertions(+), 16 deletions(-) Reviewed-by: Stefan Hajnoczi --oOB74oR0WcNeq9Zb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVSzuVAAoJEJykq7OBq3PIm9sH/3iQveEFP1xTJruXFkn2n+0r 0L02GBUs0SvOZk5QL2PfDi2rbe/IamTSLR6G7RG+mMP4jWYiAMs2+sXZNEk+/i41 qCjdEzqyx+uBTZ3h/ZvDAupUucipZ5IjA8JrAWVomqiqg8eWJ9gc59A9rEVkDnIV BE28oBDK+3LAaz+A3/B1hUclP9iuI3jJax064VOP7OYm73XVOvuQCQ5h9vYgOPAv WvqQ8201h4LLMR3gsgRqK8eSbovXLXBLnLXlZN8QNHZi86GA8Im05ZpAmFzmWnOp Z4CtBSLHprhEv3bquxypLTAGQfU0eea0Z517LpT6olqrRsylg+TDdHY4xeH8itU= =S/dJ -----END PGP SIGNATURE----- --oOB74oR0WcNeq9Zb--