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

Re: [libvirt] [REPOST PATCH v2 05/12] lib: Introduce virDomainSetIOThreadParams




On 11/15/18 4:55 AM, Michal Privoznik wrote:
> On 11/05/2018 01:58 PM, John Ferlan wrote:
>> Create a new API that will allow an adjustment of IOThread
>> polling parameters for the specified IOThread. These parameters
>> will not be saved in the guest XML. Currently the only parameters
>> supported will allow the hypervisor to adjust the parameters used
>> to limit and alter the scope of the polling interval. The polling
>> interval allows the IOThread to spend more or less time processing
>> in the guest.
>>
>> Based on code originally posted by Pavel Hrdina <phrdina redhat com>
>> to add virDomainAddIOThreadParams and virDomainModIOThreadParams.
>> Modification of those changes to use virDomainSetIOThreadParams
>> instead and remove concepts related to saving the data in guest
>> XML as well as the way to specifically enable the polling parameters.
>>
>> Signed-off-by: John Ferlan <jferlan redhat com>
>> ACKed-by: Michal Privoznik <mprivozn redhat com>
>> ---
>>  include/libvirt/libvirt-domain.h | 44 ++++++++++++++++++++
>>  src/driver-hypervisor.h          |  8 ++++
>>  src/libvirt-domain.c             | 70 ++++++++++++++++++++++++++++++++
>>  src/libvirt_public.syms          |  5 +++
>>  src/remote/remote_driver.c       |  1 +
>>  src/remote/remote_protocol.x     | 21 +++++++++-
>>  src/remote_protocol-structs      | 10 +++++
>>  7 files changed, 158 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
>> index 58fd4bc10c..bf89d0149f 100644
>> --- a/include/libvirt/libvirt-domain.h
>> +++ b/include/libvirt/libvirt-domain.h
>> @@ -1911,6 +1911,50 @@ int                  virDomainDelIOThread(virDomainPtr domain,
>>                                            unsigned int iothread_id,
>>                                            unsigned int flags);
>>  
>> +/* IOThread set parameters */
>> +
>> +/**
>> + * VIR_DOMAIN_IOTHREAD_POLL_MAX_NS:
>> + *
>> + * The maximum polling time that can be used by polling algorithm in ns.
>> + * The polling time starts at 0 (zero) and is the time spent by the guest
>> + * to process IOThread data before returning the CPU to the host. The
>> + * polling time will be dynamically modified over time based on the
>> + * poll_grow and poll_shrink parameters provided. A value set too large
>> + * will cause more CPU time to be allocated the guest. A value set too
>> + * small will not provide enough cycles for the guest to process data.
>> + * The polling interval is not available for statistical purposes.
>> + */
>> +# define VIR_DOMAIN_IOTHREAD_POLL_MAX_NS "poll_max_ns"
>> +
>> +/**
>> + * VIR_DOMAIN_IOTHREAD_POLL_GROW:
>> + *
>> + * This provides a value for the dynamic polling adjustment algorithm to
>> + * use to grow its polling interval up to the poll_max_ns value. A value
>> + * of 0 (zero) allows the hypervisor to choose its own value. The algorithm
>> + * to use for adjustment is hypervisor specific.
>> + */
>> +# define VIR_DOMAIN_IOTHREAD_POLL_GROW "poll_grow"
>> +
>> +/**
>> + * VIR_DOMAIN_IOTHREAD_POLL_SHRINK:
>> + *
>> + * This provides a value for the dynamic polling adjustment algorithm to
>> + * use to shrink its polling interval when the polling interval exceeds
>> + * the poll_max_ns value. A value of 0 (zero) allows the hypervisor to
>> + * choose its own value. The algorithm to use for adjustment is hypervisor
>> + * specific.
>> + */
>> +# define VIR_DOMAIN_IOTHREAD_POLL_SHRINK "poll_shrink"
>> +
>> +int                  virDomainSetIOThreadParams(virDomainPtr domain,
> 
> On a completely unrelated note, this is stupid. I mean the amount of
> spaces after 'int'. I wonder if a patch that reformats all the header
> files would be accepted.

I agree with the spacing... I assumed it had something to do with the
docs pages generation; however, a quick test shows that by removing the
extraneous spaces doesn't change the format that I can see in the docs.
Furthermore there are other API's which don't do any spacing.

So perhaps a nice task for a first time contributor to remove the spaces
*and* make sure that it doesn't affect the webpage.

Tks -

John

Since it'll conflict - I'll wait for you to push the 'memfd' stuff first
w/ capabilities changes before pushing this...  but don't wait too long ;-)

> 
> The ACK still holds.
> 
>> +                                                unsigned int iothread_id,
>> +                                                virTypedParameterPtr params,
>> +                                                int nparams,
>> +                                                unsigned int flags);
> 
> Michal
> 


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