All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization
@ 2011-09-13  7:53 Frediano Ziglio
  2011-09-13  7:53 ` [Qemu-devel] [PATCH][RFC][1/2] qcow2: optimize refminus updates Frediano Ziglio
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Frediano Ziglio @ 2011-09-13  7:53 UTC (permalink / raw)
  To: kwolf; +Cc: qemu-devel, Frediano Ziglio

These patches try to trade-off between leaks and speed for clusters
refcounts.

Refcount increments (REF+ or refp) are handled in a different way from
decrements (REF- or refm). The reason it that posting or not flushing
a REF- cause "just" a leak while posting a REF+ cause a corruption.

To optimize REF- I just used an array to store offsets then when a
flush is requested or array reach a limit (currently 1022) the array
is sorted and written to disk. I use an array with offset instead of
ranges to support compression (an offset could appear multiple times
in the array).
I consider this patch quite ready.

To optimize REF+ I mark a range as allocated and use this range to
get new ones (avoiding writing refcount to disk). When a flush is
requested or in some situations (like snapshot) this cache is disabled
and flushed (written as REF-).
I do not consider this patch ready, it works and pass all io-tests
but for instance I would avoid allocating new clusters for refcount
during preallocation.

End speed up is quite visible allocating clusters (more then 20%).


Frediano Ziglio (2):
  qcow2: optimize refminus updates
  qcow2: ref+ optimization

 block/qcow2-refcount.c |  270 +++++++++++++++++++++++++++++++++++++++++++++---
 block/qcow2.c          |    2 +
 block/qcow2.h          |   16 +++
 3 files changed, 275 insertions(+), 13 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-09-15  7:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13  7:53 [Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization Frediano Ziglio
2011-09-13  7:53 ` [Qemu-devel] [PATCH][RFC][1/2] qcow2: optimize refminus updates Frediano Ziglio
2011-09-13  7:53 ` [Qemu-devel] [PATCH][RFC][2/2] qcow2: ref+ optimization Frediano Ziglio
2011-09-13 10:37 ` [Qemu-devel] [PATCH][RFC][0/2] REF+/REF- optimization Kevin Wolf
2011-09-13 13:36   ` Frediano Ziglio
2011-09-14  9:10     ` Kevin Wolf
2011-09-14  9:52       ` Frediano Ziglio
2011-09-14 10:21         ` Kevin Wolf
2011-09-14 11:49           ` Frediano Ziglio
2011-09-15  7:24           ` Frediano Ziglio
2011-09-13 14:55   ` Frediano Ziglio

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.