[libvirt] [v5 0/9] Support cache tune in libvirt
Marcelo Tosatti
mtosatti at redhat.com
Tue Feb 14 17:34:05 UTC 2017
On Mon, Feb 13, 2017 at 03:46:38PM +0800, Eli Qiao wrote:
> 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;...
Working as expected:
<cachetune id='10' host_id='1' type='l3' size='2816' unit='KiB' vcpus='1' />
# cat schemata
L3DATA:0=1;1=80000
L3CODE:0=1;1=80000
---
<cachetune id='10' host_id='1' type='l3code' size='2816' unit='KiB'
vcpus='1' />
<cachetune id='11' host_id='1' type='l3data' size='2816' unit='KiB'
vcpus='1' />
# cat schemata
L3DATA:0=1;1=40000
L3CODE:0=1;1=80000
Thanks.
More information about the libvir-list
mailing list