All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Frank Myhr <fmyhr@larkmoor.net>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com,
	eblake@redhat.com, berto@igalia.com, eswierk@skyportsystems.com
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes
Date: Fri, 7 Oct 2016 10:14:32 +0200	[thread overview]
Message-ID: <20161007081432.GA4589@noname.redhat.com> (raw)
In-Reply-To: <70fbc326-29b6-ca3c-54ed-201b46d71cf0@larkmoor.net>

[ Restoring the CC list, adding Eric for QAPI ]

Am 06.10.2016 um 20:36 hat Frank Myhr geschrieben:
> Thanks Alberto for pointing me to Ed Swierk's patch and this discussion.
> 
> On Wed 05 Oct 2016 16:57:57 +0200, Alberto Garcia wrote:
> 
> > Frank Myhr's suggestion (in bugzilla) is that we allow specifying a % of
> > the disk size, so
> >
> > l2-cache-size=100%  (that would be cache-size=max)
> > l2-cache-size=80%
> > ...
> >
> > https://bugzilla.redhat.com/show_bug.cgi?id=1377735#c3
> >
> > [This] would change however the data type of
> > 'l2-cache-size' from int to string in BlockdevOptionsQcow2, can we
> > actually do that?
> 
> Maybe pass a negative integer to indicate percentage, so string is not required?:
> l2-cache-size=-100    (l2-cache-size=max, covers entire drive)
> l2-cache-size=-50     (l2-cache-size=50% of max, covers half of drive)
> l2-cache-size=2097152 (l2-cache-size=2M)

No, this is the kind of magic that is best to avoid.

If you want to have two different ways to configure the cache, make it
two different options.

> On Wed 5 Oct 2016 17:13:39 +0200, Max Reitz wrote;
> 
> > maybe it would make more sense to introduce a whole new set of
> > options called {,l2-,refcount-}cache-coverage or something. These
> > options would then accept both an absolute and a relative number.
> 
> On Wed 5 Oct 2016 17:24:08 +0200, Kevin Wolf wrote:
> 
> > If we want easy, make it easy: cache-coverage and apply it to both.
> 
> refcount-cache-size if unspecified is now automatically set to
> l2-cache-size / 4, correct? So if we could specify l2-cache-size as
> "max" or in percentage, it seems that refcount-cache-size is already
> taken care if we if just leave it unspecified.

Yes.

> On Thu 06 Oct 2016 16:34:16 +0200, Alberto Garcia wrote:
> > I don't think it's a good
> > idea to have two ways to specify exactly the same thing, when one can be
> > converted to the other with a very simple operation.
> 
> I agree. For better or worse we already have l2-cache-size. If its
> accepted values can be slightly expanded, using either a "max" enum
> as Max Reitz suggested, or somehow indicating a relative
> (percentage) value rather than an absolute number of bytes, this
> seems to offer sufficient flexibility for a broad range of users.
> 
> Although the percentage of max l2 cache size isn't exactly an
> intuitive number to specify, it's also (as Alberto notes) equal to
> the percentage of drive size covered by the cache. That's only
> marginally harder to think about than the absolute drive size
> covered by cache that a cache-coverage parameter would specify.

I think we can add "max" as an additional accepted value to
l2-cache-size, but if we want to allow percentages, that should be a
separate option (because we can't easily parse "50%" with QAPI except if
treating it as a string, but that wouldn't be quite right).

Kevin

       reply	other threads:[~2016-10-07  8:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <70fbc326-29b6-ca3c-54ed-201b46d71cf0@larkmoor.net>
2016-10-07  8:14 ` Kevin Wolf [this message]
2016-10-07 10:56   ` [Qemu-devel] [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes Alberto Garcia
2016-10-07 13:46     ` Frank Myhr
2016-10-07 13:58       ` Ed Swierk
2016-10-18 15:25         ` Alberto Garcia
2016-10-19 16:34           ` Frank Myhr
2016-10-04 13:39 [Qemu-devel] " Ed Swierk
2016-10-04 14:31 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2016-10-04 15:36   ` Ed Swierk
2016-10-04 15:51     ` Max Reitz
2016-10-05 14:57       ` Alberto Garcia
2016-10-05 15:13         ` Max Reitz
2016-10-05 15:19           ` Alberto Garcia
2016-10-05 15:35             ` Max Reitz
2016-10-06 14:34               ` Alberto Garcia
2016-10-05 15:24           ` Kevin Wolf

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=20161007081432.GA4589@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=berto@igalia.com \
    --cc=eblake@redhat.com \
    --cc=eswierk@skyportsystems.com \
    --cc=fmyhr@larkmoor.net \
    --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.