From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJjcI-0005iy-N8 for qemu-devel@nongnu.org; Fri, 06 Feb 2015 09:10:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJjcE-0004PE-LN for qemu-devel@nongnu.org; Fri, 06 Feb 2015 09:10:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJjcE-0004P3-Dv for qemu-devel@nongnu.org; Fri, 06 Feb 2015 09:10:38 -0500 Date: Fri, 6 Feb 2015 15:09:53 +0100 From: Kevin Wolf Message-ID: <20150206140953.GF13081@noname.redhat.com> References: <1423140931-11823-1-git-send-email-berto@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423140931-11823-1-git-send-email-berto@igalia.com> Subject: Re: [Qemu-devel] [PATCH] block: Give always priority to unused entries in the qcow2 L2 cache List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: qemu-devel@nongnu.org, Stefan Hajnoczi Am 05.02.2015 um 13:55 hat Alberto Garcia geschrieben: > The current algorithm to replace entries from the L2 cache gives > priority to newer hits by dividing the hit count of all existing > entries by two everytime there is a cache miss. > > However, if there are several cache misses the hit count of the > existing entries can easily go down to 0. This will result in those > entries being replaced even when there are others that have never been > used. > > This problem is more noticeable with larger disk images and cache > sizes, since the chances of having several misses before the cache is > full are higher. > > If we make sure that the hit count can never go down to 0 again, > unused entries will always have priority. > > Signed-off-by: Alberto Garcia Thanks, applied to the block branch. Kevin