[libvirt] [PATCH RFC 2/2] Resctrl: Add uitls functions to operate sysfs resctrl

Eli Qiao qiaoliyong at gmail.com
Thu Jun 22 05:27:32 UTC 2017



On Wednesday, 21 June 2017 at 10:44 PM, Martin Kletzander wrote:

> You don't need to pass the whole structure of all the data. Can't the
> qemu function just do something like:
> 
> virResctrlLock()
> foreach cachetune:
> region = virResctrlGetFreeRegion(size, type)
> foreach cachetune.vcpu:
> virResctrlSetRegion(vcpu.pid, region)
> 
Sure, good suggestion, I will try to read what other tune does. 
> 
> Or like with some other tuning, you can have a function that determines
> the region when given vcpu and just call it for all vcpus. You can
> save the regions in the status XML, so that not only users can see it,
> but you can also reference them from that aforementioned function. Or
> you could have saved pairs of id: region, but I think that's not needed.
> 
> That reminds me, unless referred to from somewhere, the cachetune
> doesn't even need the id.
> 
> But basically, you don't need to pass the whole cachetune or any other
> structure. The code is very messy, check your pointers and don't
> compare references to NULLs. Read the diffs after yourself. I know it
> works for you, but the code needs to be readable as well.


Forgive me I am not a qualified c programmer for years :(, I will try to 
refine them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170622/7a5e3357/attachment-0001.htm>


More information about the libvir-list mailing list