[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 0/3] add disk driver metadata_cache_size option



On Fri, Nov 02, 2018 at 11:11:50 +0100, Kevin Wolf wrote:
> Am 01.11.2018 um 12:32 hat Nikolay Shirokovskiy geschrieben:
> > Hi, all.
> > 
> > This is a patch series after offlist agreement on introducing
> > metadata-cache-size option for disks. The options itself is described in 2nd
> > patch of the series.
> > 
> > There is a plenty of attempts to add option to set qcow2 metadata cache sizes in
> > past, see [1] [2] to name recent that has comments I tried to address or has
> > work I reused to some extent.
> > 
> > I would like to address Peter's comment in [1] that this option is image's
> > option rather then disk's here. While this makes sense if we set specific cache
> > value that covers disk only partially, here when we have maximum policy that
> > covers whole disk it makes sense to set same value for all images. The setted
> > value is only upper limit on cache size and thus cache for every image will
> > grow proportionally to image data size "visible from top" eventually I guess.
> > And these sizes are changing during guest lifetime - thus we need set whole
> > disk limit for every image for 'maxium' effect.
> > 
> > On the other hand if we add policies different from 'maximum' it may require
> > per image option. Well I can't imagine name for element for backing chain that
> > will have cache size attribute better then 'driver'). And driver is already
> > used for top image so I leave it this way.
> > 
> >   KNOWN ISSUES
> > 
> > 1. when using -driver to configure disks in command line cache size does not
> >    get propagated thru backing chain
> > 
> > 2. when making external disk snapshot cache size sneak into backing file
> >    filename and thus cache size for backing image became remembered there
> > 
> > 3. blockcommit after such snapshot will not work because libvirt is not ready
> >    for backing file name is reported as json sometimes
> > 
> > Looks like 1 can be addressed in qemu.
> 
> I don't think we want to add inheritance of driver-specific options.
> Option inheritance is already a bit messy with options that every driver
> understands.
> 
> And -drive is the obsolete interface anyway, when you use -blockdev you
> specify all nodes explicitly.

So this would mean we get different behaviour depending on whether
-blockdev is supported by libvirt and qemu or not.

This means that there are the following possibilities:

1) allow this feature only with -blockdev

2) limit this only to the top layer image

3) make it configurable per backing chain entry.

Given our discussion on the KVM forum, I don't think it makes sense to
do 3, 2 would make it incomplete, so 1 is the only reasonable option if
qemu will not do the inheritance.

> > The reason for behaviour in 2 I do not understand honestly.
> 
> QEMU doesn't recognise that the cache size option doesn't affect which
> data you're accessing. Max had a series that should probably fix it.
> Maybe we should finally get it merged.
> 
> Anyway, I suppose if you use libvirt in -blockdev mode, it doesn't make
> a difference anyway, because libvirt should then manually call
> blockdev-create for the overlay and therefore specify the backing file
> string explicitly.

Yes, in that case we'll create it manually with the correct backing
store path. Currently we'd ignore such an entry in the backing store
path when detecting the chain from the disk so this should not affect
anything.

> Can you confirm this in practice?
> 
> > And 3 will be naturally addessed after blockjobs starts working with
> > blockdev configuration I guess.

Did you test this? We do support backing files with 'json:' pseudo
protocol.

> 
> Hopefully (Peter?), but depending on 2. it might not even be necessary
> if libvirt doesn't explicitly store json: pseudo-filenames.

Well, we will store them eventually in json pseudo-protocol format since
in some cases (e.g. multi-host gluster) we don't have any other option.

Attachment: signature.asc
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]