[libvirt] [v7 00/10] Support cache tune in libvirt

Eli Qiao posted 10 patches 7 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1487237721-74466-1-git-send-email-liyong.qiao@intel.com
There is a newer version of this series
docs/schemas/domaincommon.rng |   46 ++
include/libvirt/virterror.h   |    1 +
po/POTFILES.in                |    1 +
src/Makefile.am               |    1 +
src/conf/capabilities.c       |   56 ++
src/conf/capabilities.h       |   23 +
src/conf/domain_conf.c        |  182 +++++++
src/conf/domain_conf.h        |   19 +
src/libvirt_private.syms      |   11 +
src/nodeinfo.c                |   64 +++
src/nodeinfo.h                |    1 +
src/qemu/qemu_capabilities.c  |    8 +
src/qemu/qemu_driver.c        |    6 +
src/qemu/qemu_process.c       |   53 ++
src/util/virerror.c           |    1 +
src/util/virresctrl.c         | 1202 +++++++++++++++++++++++++++++++++++++++++
src/util/virresctrl.h         |   88 +++
17 files changed, 1763 insertions(+)
create mode 100644 src/util/virresctrl.c
create mode 100644 src/util/virresctrl.h
[libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Eli Qiao 7 years, 1 month ago
Addressed comment from v7 -> v6

Marcelo:
       * Fix flock usage while VM initialization.

Addressed comment from v6 -> v5

Marcelo:
       * Support other APPs to operate /sys/fs/resctrl at same time

         Libvirt will scan /sys/fs/resctrl again before doing cache allocation.
         patch 10 will address this.

Addressed comment from v4 -> v5:

Marcelo:
       * Several typos
       * Use flock instead of virFileLock

Addressed comment from v3 -> v4:

Daniel & Marcelo:
       * Added concurrence support

Addressed comment from v2 -> v3:

Daniel:
      * Fixed coding style, passed `make check` and `make syntax-check`

      * Variables renaming and move from header file to c file.

      * For locking/mutex support, no progress.

      There are some discussion from mailing list, but I can not find a better
      way to add locking support without performance impact.

      I'll explain the process and please help to advice what shoud we do.

      VM create:
      1) Get the cache left value on each bank of the host. This should be
         shared amount all VMs.
      2) Calculate the schemata on the bank based on all created resctrl
         domain's schemata
      3) Calculate the default schemata by scaning all domain's schemata.
      4) Flush default schemata to /sys/fs/resctrl/schemata

      VM destroy:
      1) Remove the resctrl domain of that VM
      2) Recalculate default schemata
      3) Flush default schemata to /sys/fs/resctrl/schemata

      The key point is that all VMs shares /sys/fs/resctrl/schemata, and
      when a VM create a resctrl domain, the schemata of that VM depends on
      the default schemata and all other exsited schematas. So a global
      mutex is reqired.

      Before calculate a schemata or update default schemata, libvirt
      should gain this global mutex.

      I will try to think more about how to support this gracefully in next
      patch set.

Marcelo:
      * Added vcpu support for cachetune, this will allow user to define which
        vcpu using which cache allocation bank.

        <cachetune id='0' host_id=0 size='3072' unit='KiB' vcpus='0,1'/>

        vcpus is a cpumap, the vcpu pids will be added to tasks file

      * Added cdp compatible, user can specify l3 cache even host enable cdp.
        See patch 8.
        On a cdp enabled host, specify l3code/l3data by

        <cachetune id='0' host_id='0' type='l3' size='3072' unit='KiB'/>

        This will create a schemata like:
            L3data:0=0xff00;...
            L3code:0=0xff00;...

      * Would you please help to test if the functions work.

Martin:
      * Xml test case, I have no time to work on this yet, would you please
        show me an example, would like to amend it later.

This series patches are for supportting CAT featues, which also
called cache tune in libvirt.

First to expose cache information which could be tuned in capabilites XML.
Then add new domain xml element support to add cacahe bank which will apply
on this libvirt domain.

This series patches add a util file `resctrl.c/h`, an interface to talk with
linux kernel's system fs.

There are still one TODO left:
    1. Expose a new public interface to get free cache information.
    2. Expose a new public interface to set cachetune lively.

Some discussion about this feature support can be found from:
https://www.redhat.com/archives/libvir-list/2017-January/msg00644.html


*** BLURB HERE ***

Eli Qiao (10):
  Resctrl: Add some utils functions
  Resctrl: expose cache information to capabilities
  Resctrl: Add new xml element to support cache tune
  Resctrl: Add private interface to set cachebanks
  Qemu: Set cache banks
  Resctrl: enable l3code/l3data
  Resctrl: Make sure l3data/l3code are pairs
  Resctrl: Compatible mode for cdp enabled
  Resctrl: concurrence support
  Resctrl: Scan resctrl before doing cache allocation

 docs/schemas/domaincommon.rng |   46 ++
 include/libvirt/virterror.h   |    1 +
 po/POTFILES.in                |    1 +
 src/Makefile.am               |    1 +
 src/conf/capabilities.c       |   56 ++
 src/conf/capabilities.h       |   23 +
 src/conf/domain_conf.c        |  182 +++++++
 src/conf/domain_conf.h        |   19 +
 src/libvirt_private.syms      |   11 +
 src/nodeinfo.c                |   64 +++
 src/nodeinfo.h                |    1 +
 src/qemu/qemu_capabilities.c  |    8 +
 src/qemu/qemu_driver.c        |    6 +
 src/qemu/qemu_process.c       |   53 ++
 src/util/virerror.c           |    1 +
 src/util/virresctrl.c         | 1202 +++++++++++++++++++++++++++++++++++++++++
 src/util/virresctrl.h         |   88 +++
 17 files changed, 1763 insertions(+)
 create mode 100644 src/util/virresctrl.c
 create mode 100644 src/util/virresctrl.h

--
1.9.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Marcelo Tosatti 7 years, 1 month ago
Hi Eli Qiao,

Question about removing resctrlfs directories with empty "tasks" file.


            /* This domain is not created by libvirt, so we don't care
             * about the tasks, add a fake one to prevent
             * virResCtrlRefresh
             * remove it from sysfs */
            virResCtrlAddTask(p, 1);
            virResCtrlAppendDomain(p);

/* Refresh all domains', remove the domains which has no task ids.
 * This will be used after VM pause, restart, destroy etc.
 */
static int
virResCtrlRefresh(void)

Why are you doing this (removing directories which have no tasks in
them) ? The code should only read information from other
CAT reservations, not write to them.


This is not for cleanup purposes, since on VM shutdown the resctrlfs 
directories are properly removed:

/* Remove the Domain from sysfs, this should only success no pids in
 * tasks
 * of a partition.
 */
static
int virResCtrlRemoveDomain(const char *name)
{
    char *path = NULL;
    int rc = 0;

    if ((rc = virAsprintf(&path, "%s/%s", RESCTRL_DIR, name)) < 0)
        return rc;
    rc = rmdir(path);
    VIR_FREE(path);
    return rc;
}

Should not write to other directories 'tasks' file.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Eli Qiao 7 years, 1 month ago

--  
Best regards  
Eli

天涯无处不重逢
a leaf duckweed belongs to the sea, where not to meet in life  

Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Sunday, 19 February 2017 at 10:51 PM, Marcelo Tosatti wrote:

>  
> Hi Eli Qiao,
>  
> Question about removing resctrlfs directories with empty "tasks" file.
>  
>  
> /* This domain is not created by libvirt, so we don't care
> * about the tasks, add a fake one to prevent
> * virResCtrlRefresh
> * remove it from sysfs */
> virResCtrlAddTask(p, 1);
> virResCtrlAppendDomain(p);
>  
> /* Refresh all domains', remove the domains which has no task ids.
> * This will be used after VM pause, restart, destroy etc.
> */
> static int
> virResCtrlRefresh(void)
>  
> Why are you doing this (removing directories which have no tasks in
> them) ? The code should only read information from other
> CAT reservations, not write to them.
>  
>  
When a VM get shutdown, their pids will disappear from resctrl’s directory, we can check pids to see if VM get KIlled or not.

The reason why I would like check if tasks file empty is that: there maybe cases that libvirtd not tracking VM’s status, and the VM gone, left a empty directory with no tasks assigned, and cause resource leak.

I think I can refine this later, keep a pointer of ResDomain in VM’s private data and use that to destroy VM’s resctrl directory.

but this won’t work for exception, still resource leak happened.
  
> This is not for cleanup purposes, since on VM shutdown the resctrlfs  
> directories are properly removed:
>  
> /* Remove the Domain from sysfs, this should only success no pids in
> * tasks
> * of a partition.
> */
> static
> int virResCtrlRemoveDomain(const char *name)
> {
> char *path = NULL;
> int rc = 0;
>  
> if ((rc = virAsprintf(&path, "%s/%s", RESCTRL_DIR, name)) < 0)
> return rc;
> rc = rmdir(path);
> VIR_FREE(path);
> return rc;
> }
>  
> Should not write to other directories 'tasks' file.

Other Apps can have a lock to resctrl before it write tasks to prevent libvirtd remove empty task directory.

  

   

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Martin Kletzander 7 years, 1 month ago
On Mon, Feb 20, 2017 at 04:32:19PM +0800, Eli Qiao wrote:
>
>
>--
>Best regards
>Eli
>
>天涯无处不重逢
>a leaf duckweed belongs to the sea, where not to meet in life
>
>Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
>On Sunday, 19 February 2017 at 10:51 PM, Marcelo Tosatti wrote:
>
>>
>> Hi Eli Qiao,
>>
>> Question about removing resctrlfs directories with empty "tasks" file.
>>
>>
>> /* This domain is not created by libvirt, so we don't care
>> * about the tasks, add a fake one to prevent
>> * virResCtrlRefresh
>> * remove it from sysfs */
>> virResCtrlAddTask(p, 1);
>> virResCtrlAppendDomain(p);
>>
>> /* Refresh all domains', remove the domains which has no task ids.
>> * This will be used after VM pause, restart, destroy etc.
>> */
>> static int
>> virResCtrlRefresh(void)
>>
>> Why are you doing this (removing directories which have no tasks in
>> them) ? The code should only read information from other
>> CAT reservations, not write to them.
>>
>>
>When a VM get shutdown, their pids will disappear from resctrl’s directory, we can check pids to see if VM get KIlled or not.
>
>The reason why I would like check if tasks file empty is that: there maybe cases that libvirtd not tracking VM’s status, and the VM gone, left a empty directory with no tasks assigned, and cause resource leak.
>
>I think I can refine this later, keep a pointer of ResDomain in VM’s private data and use that to destroy VM’s resctrl directory.
>
>but this won’t work for exception, still resource leak happened.
>

Function qemuProcessStop() will *always* be called to cleanup after VMs,
all exceptions should be taken into account, so don't worry, just do
proper cleanup.

>> This is not for cleanup purposes, since on VM shutdown the resctrlfs
>> directories are properly removed:
>>
>> /* Remove the Domain from sysfs, this should only success no pids in
>> * tasks
>> * of a partition.
>> */
>> static
>> int virResCtrlRemoveDomain(const char *name)
>> {
>> char *path = NULL;
>> int rc = 0;
>>
>> if ((rc = virAsprintf(&path, "%s/%s", RESCTRL_DIR, name)) < 0)
>> return rc;
>> rc = rmdir(path);
>> VIR_FREE(path);
>> return rc;
>> }
>>
>> Should not write to other directories 'tasks' file.
>
>Other Apps can have a lock to resctrl before it write tasks to prevent libvirtd remove empty task directory.
>
>
>
>
>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Eli Qiao 7 years, 1 month ago

--  
Best regards  
Eli

天涯无处不重逢
a leaf duckweed belongs to the sea, where not to meet in life  

Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Monday, 20 February 2017 at 5:07 PM, Martin Kletzander wrote:

> On Mon, Feb 20, 2017 at 04:32:19PM +0800, Eli Qiao wrote:
> >  
> >  
> > --
> > Best regards
> > Eli
> >  
> > 天涯无处不重逢
> > a leaf duckweed belongs to the sea, where not to meet in life
> >  
> > Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > On Sunday, 19 February 2017 at 10:51 PM, Marcelo Tosatti wrote:
> >  
> > >  
> > > Hi Eli Qiao,
> > >  
> > > Question about removing resctrlfs directories with empty "tasks" file.
> > >  
> > >  
> > > /* This domain is not created by libvirt, so we don't care
> > > * about the tasks, add a fake one to prevent
> > > * virResCtrlRefresh
> > > * remove it from sysfs */
> > > virResCtrlAddTask(p, 1);
> > > virResCtrlAppendDomain(p);
> > >  
> > > /* Refresh all domains', remove the domains which has no task ids.
> > > * This will be used after VM pause, restart, destroy etc.
> > > */
> > > static int
> > > virResCtrlRefresh(void)
> > >  
> > > Why are you doing this (removing directories which have no tasks in
> > > them) ? The code should only read information from other
> > > CAT reservations, not write to them.
> > >  
> >  
> > When a VM get shutdown, their pids will disappear from resctrl’s directory, we can check pids to see if VM get KIlled or not.
> >  
> > The reason why I would like check if tasks file empty is that: there maybe cases that libvirtd not tracking VM’s status, and the VM gone, left a empty directory with no tasks assigned, and cause resource leak.
> >  
> > I think I can refine this later, keep a pointer of ResDomain in VM’s private data and use that to destroy VM’s resctrl directory.
> >  
> > but this won’t work for exception, still resource leak happened.
>  
> Function qemuProcessStop() will *always* be called to cleanup after VMs,
> all exceptions should be taken into account, so don't worry, just do
> proper cleanup.
>  
>  

hi Martin, thanks for your reply, I am thinking if qemu process being killed while libvirtd not running? will qemuProcessStop called in such case?  
>  
> > > This is not for cleanup purposes, since on VM shutdown the resctrlfs
> > > directories are properly removed:
> > >  
> > > /* Remove the Domain from sysfs, this should only success no pids in
> > > * tasks
> > > * of a partition.
> > > */
> > > static
> > > int virResCtrlRemoveDomain(const char *name)
> > > {
> > > char *path = NULL;
> > > int rc = 0;
> > >  
> > > if ((rc = virAsprintf(&path, "%s/%s", RESCTRL_DIR, name)) < 0)
> > > return rc;
> > > rc = rmdir(path);
> > > VIR_FREE(path);
> > > return rc;
> > > }
> > >  
> > > Should not write to other directories 'tasks' file.
> >  
> > Other Apps can have a lock to resctrl before it write tasks to prevent libvirtd remove empty task directory.  

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Marcelo Tosatti 7 years, 1 month ago
On Mon, Feb 20, 2017 at 04:32:19PM +0800, Eli Qiao wrote:
> 
> 
> --  
> Best regards  
> Eli
> 
> 天涯无处不重逢
> a leaf duckweed belongs to the sea, where not to meet in life  
> 
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> 
> 
> On Sunday, 19 February 2017 at 10:51 PM, Marcelo Tosatti wrote:
> 
> >  
> > Hi Eli Qiao,
> >  
> > Question about removing resctrlfs directories with empty "tasks" file.
> >  
> >  
> > /* This domain is not created by libvirt, so we don't care
> > * about the tasks, add a fake one to prevent
> > * virResCtrlRefresh
> > * remove it from sysfs */
> > virResCtrlAddTask(p, 1);
> > virResCtrlAppendDomain(p);
> >  
> > /* Refresh all domains', remove the domains which has no task ids.
> > * This will be used after VM pause, restart, destroy etc.
> > */
> > static int
> > virResCtrlRefresh(void)
> >  
> > Why are you doing this (removing directories which have no tasks in
> > them) ? The code should only read information from other
> > CAT reservations, not write to them.
> >  
> >  
> When a VM get shutdown, their pids will disappear from resctrl’s directory, we can check pids to see if VM get KIlled or not.
> 
> The reason why I would like check if tasks file empty is that: there maybe cases that libvirtd not tracking VM’s status, and the VM gone, left a empty directory with no tasks assigned, and cause resource leak.
> 
> I think I can refine this later, keep a pointer of ResDomain in VM’s private data and use that to destroy VM’s resctrl directory.
> 
> but this won’t work for exception, still resource leak happened.

Can you explain how the resource leak can happen?

Why it is not possible to maintain that information inside libvirt
itself?

> > This is not for cleanup purposes, since on VM shutdown the resctrlfs  
> > directories are properly removed:
> >  
> > /* Remove the Domain from sysfs, this should only success no pids in
> > * tasks
> > * of a partition.
> > */
> > static
> > int virResCtrlRemoveDomain(const char *name)
> > {
> > char *path = NULL;
> > int rc = 0;
> >  
> > if ((rc = virAsprintf(&path, "%s/%s", RESCTRL_DIR, name)) < 0)
> > return rc;
> > rc = rmdir(path);
> > VIR_FREE(path);
> > return rc;
> > }
> >  
> > Should not write to other directories 'tasks' file.
> 
> Other Apps can have a lock to resctrl before it write tasks to prevent libvirtd remove empty task directory.

Well then libvirt will never be able to change resctrl filesystem?

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Eli Qiao 7 years, 1 month ago

--  
Best regards  
Eli

天涯无处不重逢
a leaf duckweed belongs to the sea, where not to meet in life  

Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Tuesday, 21 February 2017 at 4:54 AM, Marcelo Tosatti wrote:

> Can you explain how the resource leak can happen?
>  
1. libvirtd creates a qemu process and create a resctrl directory for it, add it’s pids to tasks
2. stop libvirtd or it’s down.
3. qemu process, and tasks file is empty now.
4. libvirt restart, well, the resctrl directory should be deleted as qemu process gone.
> Why it is not possible to maintain that information inside libvirt
> itself?
>  
> > > This is not for cleanup purposes, since on VM shutdown the resctrlfs  
> > > directories are properly removed:
> > > /* Remove the Domain from sysfs, this should only success no pids in
> > > * tasks
> > > * of a partition.
> > > */
> > > static
> > > int virResCtrlRemoveDomain(const char *name)
> > > {
> > > char *path = NULL;
> > > int rc = 0;
> > > if ((rc = virAsprintf(&path, "%s/%s", RESCTRL_DIR, name)) < 0)
> > > return rc;
> > > rc = rmdir(path);
> > > VIR_FREE(path);
> > > return rc;
> > > }
> > > Should not write to other directories 'tasks' file.
> > >  
> >  
> >  
> > Other Apps can have a lock to resctrl before it write tasks to prevent libvirtd remove empty task directory.
>  
> Well then libvirt will never be able to change resctrl filesystem?  
no, Apps only grant lock when it creates new cache allocation, should release the lock after adding the app’s pid to tasks.  
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Marcelo Tosatti 7 years, 1 month ago
On Tue, Feb 21, 2017 at 10:25:13AM +0800, Eli Qiao wrote:
> 
> 
> --  
> Best regards  
> Eli
> 
> 天涯无处不重逢
> a leaf duckweed belongs to the sea, where not to meet in life  
> 
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> 
> 
> On Tuesday, 21 February 2017 at 4:54 AM, Marcelo Tosatti wrote:
> 
> > Can you explain how the resource leak can happen?
> >  
> 1. libvirtd creates a qemu process and create a resctrl directory for it, add it’s pids to tasks
> 2. stop libvirtd or it’s down.
> 3. qemu process, and tasks file is empty now.
> 4. libvirt restart, well, the resctrl directory should be deleted as qemu process gone.

So there are two problems: 

P1) If libvirtd is not restarted and guest VM is poweredoff, then 
CAT reservation leaks.

Ideally QEMU should free the resources.

How does libvirt deal with this for other resources?

P2) Libvirt restart.

Please remove resctrlfs directory only for 
libvirt owned VMs (say if the directory name matches
the VM UUID), and not for all directories in resctrlfs
(should not change resctrlfs directories which libvirt
does not own).

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Eli Qiao 7 years, 1 month ago

--  
Best regards  
Eli

天涯无处不重逢
a leaf duckweed belongs to the sea, where not to meet in life  

Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Wednesday, 22 February 2017 at 7:36 AM, Marcelo Tosatti wrote:

> On Tue, Feb 21, 2017 at 10:25:13AM +0800, Eli Qiao wrote:
> >  
> >  
> > --  
> > Best regards  
> > Eli
> >  
> > 天涯无处不重逢
> > a leaf duckweed belongs to the sea, where not to meet in life  
> >  
> > Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > On Tuesday, 21 February 2017 at 4:54 AM, Marcelo Tosatti wrote:
> >  
> > > Can you explain how the resource leak can happen?
> > >  
> > >  
> >  
> > 1. libvirtd creates a qemu process and create a resctrl directory for it, add it’s pids to tasks
> > 2. stop libvirtd or it’s down.
> > 3. qemu process, and tasks file is empty now.
> > 4. libvirt restart, well, the resctrl directory should be deleted as qemu process gone.
> >  
>  
>  
> So there are two problems:  
>  
> P1) If libvirtd is not restarted and guest VM is poweredoff, then  
> CAT reservation leaks.
>  
> Ideally QEMU should free the resources.
>  
yes, but qemu doesn’t care about CAT stuff.  
>  
> How does libvirt deal with this for other resources?
>  
>  


I tested with libvirt, if qemu process exited while libvirtd is not running, next time when libvirtd restart, it will do something cleanup like it will call qemuprocessexit(), so libvirt can aware qemu process exited.  
>  
> P2) Libvirt restart.
>  
Yes.   
>  
> Please remove resctrlfs directory only for  
> libvirt owned VMs (say if the directory name matches
> the VM UUID), and not for all directories in resctrlfs
>  
>  

Yep, I ‘v done the patch update yesterday, and will send out new version today.  
> (should not change resctrlfs directories which libvirt
> does not own).
>  
>  


Thanks for the advices.--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Marcelo Tosatti 7 years, 1 month ago
How does the management software query the amount of allocatable cache
again? 

Section from another discussion:

> The second case is necessary to get updated free space information.
>

Just VM initialization time could be enough as virConnectGetCapabilities
would just know the total and free size would be reported in an API (if
I rememer the discussion correctly)

Martin

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Marcelo Tosatti 7 years, 1 month ago
On Sun, Feb 19, 2017 at 12:01:57PM -0300, Marcelo Tosatti wrote:
> 
> How does the management software query the amount of allocatable cache
> again? 
> 
> Section from another discussion:
> 
> > The second case is necessary to get updated free space information.
> >
> 
> Just VM initialization time could be enough as virConnectGetCapabilities
> would just know the total and free size would be reported in an API (if
> I rememer the discussion correctly)
> 
> Martin

Yes, i think this is missing because the interface was designed 
with only libvirt in mind: the "reserved" field returns the amount of 
cache reserved only by VMs.

So if there is another application on the same L3 socket 
with a cache reservation, "reserved" fails to report it. 

Eli can you expose the amount of free allocatable cache space
(where non-free includes space used by other reservations) in a
'free_space' field in the cache output of virConnectGetCapabilities?


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Martin Kletzander 7 years, 1 month ago
On Sun, Feb 19, 2017 at 12:20:55PM -0300, Marcelo Tosatti wrote:
>On Sun, Feb 19, 2017 at 12:01:57PM -0300, Marcelo Tosatti wrote:
>>
>> How does the management software query the amount of allocatable cache
>> again?
>>
>> Section from another discussion:
>>
>> > The second case is necessary to get updated free space information.
>> >
>>
>> Just VM initialization time could be enough as virConnectGetCapabilities
>> would just know the total and free size would be reported in an API (if
>> I rememer the discussion correctly)
>>
>> Martin
>
>Yes, i think this is missing because the interface was designed
>with only libvirt in mind: the "reserved" field returns the amount of
>cache reserved only by VMs.
>
>So if there is another application on the same L3 socket
>with a cache reservation, "reserved" fails to report it.
>
>Eli can you expose the amount of free allocatable cache space
>(where non-free includes space used by other reservations) in a
>'free_space' field in the cache output of virConnectGetCapabilities?
>

There should be an API for that instead.  Capabilities are supposed to
show what the hardware is capable of, not what the actual state is.

If my opinion is not enough, see here:

  https://www.redhat.com/archives/libvir-list/2017-January/msg00500.html
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [v7 00/10] Support cache tune in libvirt
Posted by Eli Qiao 7 years, 1 month ago


--  
Best regards  
Eli

天涯无处不重逢
a leaf duckweed belongs to the sea, where not to meet in life  

Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Monday, 20 February 2017 at 3:59 PM, Martin Kletzander wrote:

> On Sun, Feb 19, 2017 at 12:20:55PM -0300, Marcelo Tosatti wrote:
> > On Sun, Feb 19, 2017 at 12:01:57PM -0300, Marcelo Tosatti wrote:
> > >  
> > > How does the management software query the amount of allocatable cache
> > > again?
> > >  
> > > Section from another discussion:
> > >  
> > > > The second case is necessary to get updated free space information.
> > >  
> > > Just VM initialization time could be enough as virConnectGetCapabilities
> > > would just know the total and free size would be reported in an API (if
> > > I rememer the discussion correctly)
> > >  
> > > Martin
> >  
> > Yes, i think this is missing because the interface was designed
> > with only libvirt in mind: the "reserved" field returns the amount of
> > cache reserved only by VMs.
> >  
> > So if there is another application on the same L3 socket
> > with a cache reservation, "reserved" fails to report it.
> >  
> > Eli can you expose the amount of free allocatable cache space
> > (where non-free includes space used by other reservations) in a
> > 'free_space' field in the cache output of virConnectGetCapabilities?
> >  
>  
>  
> There should be an API for that instead. Capabilities are supposed to
> show what the hardware is capable of, not what the actual state is.
>  
> If my opinion is not enough, see here:
>  
> https://www.redhat.com/archives/libvir-list/2017-January/msg00500.html

Sure, thanks Martin point the link , the plan is to provide API to query cache left.   

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list