From: Alberto Garcia <berto@igalia.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>,
qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 0/6] qcow2 L2/refcount cache improvements
Date: Thu, 30 Apr 2015 13:11:39 +0300 [thread overview]
Message-ID: <cover.1430388393.git.berto@igalia.com> (raw)
Here are some improvements to the qcow2 L2/refcount cache code.
The first one is that all cache tables are now allocated using a
single memory block, as we discussed last week.
Apart from a more efficient use of memory, this allows some additional
optimizations so I took the chance to make other changes.
- 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.
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.
Regards,
Berto
Alberto Garcia (6):
qcow2: use one single memory block for the L2/refcount cache tables
qcow2: simplify qcow2_cache_put() and qcow2_cache_entry_mark_dirty()
qcow2: use an LRU algorithm to replace entries from the L2 cache
qcow2: remove qcow2_cache_find_entry_to_replace()
qcow2: use a hash to look for entries in the L2 cache
qcow2: style fixes in qcow2-cache.c
block/qcow2-cache.c | 149 +++++++++++++++++++++-------------------------------
1 file changed, 61 insertions(+), 88 deletions(-)
--
2.1.4
next reply other threads:[~2015-04-30 10:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 10:11 Alberto Garcia [this message]
2015-04-30 10:11 ` [Qemu-devel] [PATCH 1/6] qcow2: use one single memory block for the L2/refcount cache tables Alberto Garcia
2015-04-30 15:08 ` Eric Blake
2015-05-05 13:00 ` Alberto Garcia
2015-05-01 14:23 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-05-04 10:58 ` Kevin Wolf
2015-05-05 10:28 ` Stefan Hajnoczi
2015-05-05 11:20 ` Kevin Wolf
2015-05-05 15:09 ` Alberto Garcia
2015-05-06 14:57 ` Stefan Hajnoczi
2015-04-30 10:11 ` [Qemu-devel] [PATCH 2/6] qcow2: simplify qcow2_cache_put() and qcow2_cache_entry_mark_dirty() Alberto Garcia
2015-05-01 14:31 ` Stefan Hajnoczi
2015-05-05 13:06 ` Alberto Garcia
2015-05-06 15:00 ` Stefan Hajnoczi
2015-05-06 15:32 ` Alberto Garcia
2015-05-05 15:21 ` Eric Blake
2015-04-30 10:11 ` [Qemu-devel] [PATCH 3/6] qcow2: use an LRU algorithm to replace entries from the L2 cache Alberto Garcia
2015-04-30 10:11 ` [Qemu-devel] [PATCH 4/6] qcow2: remove qcow2_cache_find_entry_to_replace() Alberto Garcia
2015-04-30 10:11 ` [Qemu-devel] [PATCH 5/6] qcow2: use a hash to look for entries in the L2 cache Alberto Garcia
2015-05-06 16:42 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-05-07 8:23 ` Alberto Garcia
2015-04-30 10:11 ` [Qemu-devel] [PATCH 6/6] qcow2: style fixes in qcow2-cache.c Alberto Garcia
2015-05-06 16:42 ` Stefan Hajnoczi
2015-05-06 16:43 ` [Qemu-devel] [Qemu-block] [PATCH 0/6] qcow2 L2/refcount cache improvements Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1430388393.git.berto@igalia.com \
--to=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.