From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfkAN-0000kO-27 for qemu-devel@nongnu.org; Fri, 02 Sep 2016 04:49:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfkAL-0004Ri-5K for qemu-devel@nongnu.org; Fri, 02 Sep 2016 04:49:38 -0400 Date: Fri, 2 Sep 2016 10:49:24 +0200 From: Kevin Wolf Message-ID: <20160902084924.GA4513@noname.redhat.com> References: <20160829171021.4902-1-pbutsykin@virtuozzo.com> <20160829171021.4902-8-pbutsykin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160829171021.4902-8-pbutsykin@virtuozzo.com> Subject: Re: [Qemu-devel] [PATCH RFC v2 07/22] block/pcache: introduce LRU as method of memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Butsykin Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, den@openvz.org, jsnow@redhat.com, eblake@redhat.com, famz@redhat.com Am 29.08.2016 um 19:10 hat Pavel Butsykin geschrieben: > This is a simple solution to the problem of displacement of cache memory. > The LRU can be useful to avoid the displacement of the nodes, which have > been partially read. > > Signed-off-by: Pavel Butsykin > --- > block/pcache.c | 74 +++++++++++++++++++++++++++++++++++++++++++++------------- > 1 file changed, 58 insertions(+), 16 deletions(-) > > diff --git a/block/pcache.c b/block/pcache.c > index 54d4526..7504db8 100644 > --- a/block/pcache.c > +++ b/block/pcache.c > @@ -67,6 +67,11 @@ typedef struct ReqStor { > CoMutex lock; > } tree; > > + struct { > + QTAILQ_HEAD(lru_head, BlockNode) list; > + CoMutex lock; This is another lock that doesn't do anything. > + } lru; > + > uint32_t curr_size; > } ReqStor; Kevin