From: Fam Zheng <famz@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Alberto Garcia <berto@igalia.com>,
qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH RFC 0/1] Allow storing the qcow2 L2 cache in disk
Date: Tue, 13 Dec 2016 18:16:35 +0800 [thread overview]
Message-ID: <20161213101635.GC2165@lemon> (raw)
In-Reply-To: <756cfb05-61e1-7ee3-435b-93759438a52d@redhat.com>
On Tue, 12/13 09:02, Max Reitz wrote:
> > Yes but the use case is that the qcow2 image is stored in a slow disk,
> > so things will be faster if we avoid having to read it too often.
> >
> > But the data is there and it needs to be read, so we have three options:
> >
> > 1) Read it everytime we need it. It slows things down.
> > 2) Keep (part of) it in memory. It can use a lot of memory.
> > 3) Keep it in a faster disk.
> >
> > We're talking about 3) here, and this it not about creating new
> > structures, but about changing the storage backend of the existing L2
> > cache (disk rather than RAM).
>
> I'm arguing that we already have an on-disk L2 structure and that is called
> simply the L1-L2 structure in the qcow2 file. The cache only makes sense
> because it is in RAM.
I am looking at this problem from a different angle:
Assume a qcow2 image created by a known version of QEMU with the option
preallocation=falloc, it is theoretically possible to do a hacky optimization in
qcow2 I/O path that, instead of looking up in L1/L2, we can calculate file
offset for any given virtual address, by adding the file offset of LBA 0.
If we make this optimization a header extention and add it to the spec, it is no
longer a hack, and it should offer nearly the same performance as raw in all
cases - if we say raw is doing "identical mapping" from LBA to file offset, this
new operation mode of qcow2 file is basically doing a "shift by constant" mapping.
Fam
next prev parent reply other threads:[~2016-12-13 10:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-09 13:47 [Qemu-devel] [PATCH RFC 0/1] Allow storing the qcow2 L2 cache in disk Alberto Garcia
2016-12-09 13:47 ` [Qemu-devel] [PATCH RFC 1/1] qcow2: " Alberto Garcia
2016-12-09 14:05 ` [Qemu-devel] [PATCH RFC 0/1] " no-reply
2016-12-09 14:18 ` Kevin Wolf
2016-12-09 15:00 ` Alberto Garcia
2016-12-12 12:10 ` Kevin Wolf
2016-12-09 14:21 ` Max Reitz
2016-12-12 14:13 ` Alberto Garcia
2016-12-13 8:02 ` Max Reitz
2016-12-13 10:16 ` Fam Zheng [this message]
2016-12-13 12:29 ` Kevin Wolf
2016-12-13 13:04 ` Fam Zheng
2016-12-13 12:55 ` Alberto Garcia
2016-12-13 13:44 ` Max Reitz
2016-12-13 15:38 ` Alberto Garcia
2016-12-12 16:53 ` [Qemu-devel] [Qemu-block] " 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=20161213101635.GC2165@lemon \
--to=famz@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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.