[libvirt] [PATCH v4 5/9] conf: Adjust the iothreadsched expectations

John Ferlan jferlan at redhat.com
Thu Apr 23 12:01:20 UTC 2015



On 04/23/2015 07:24 AM, Peter Krempa wrote:
> On Tue, Apr 21, 2015 at 19:31:26 -0400, John Ferlan wrote:
>> With iothreadid's allowing any 'id' value for an iothread_id, the
>> iothreadsched code needs a slight adjustment to allow for "any"
>> unsigned int value in order to create the bitmap of ids that will
>> have scheduler adjustments. Adjusted the doc description as well.
>>
>> Signed-off-by: John Ferlan <jferlan at redhat.com>
>> ---
>>  docs/formatdomain.html.in                                           | 6 +++++-
>>  src/conf/domain_conf.c                                              | 2 +-
>>  .../qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-toomuch.xml | 1 +
>>  3 files changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
>> index 7af6bd7..99ce298 100644
>> --- a/docs/formatdomain.html.in
>> +++ b/docs/formatdomain.html.in
>> @@ -691,7 +691,11 @@
>>          type (values <code>batch</code>, <code>idle</code>, <code>fifo</code>,
>>          <code>rr</code>) for particular vCPU/IOThread threads (based on
>>          <code>vcpus</code> and <code>iothreads</code>, leaving out
>> -        <code>vcpus</code>/<code>iothreads</code> sets the default).  For
>> +        <code>vcpus</code>/<code>iothreads</code> sets the default). Valid
>> +        <code>vcpus</code> values start at 0 through one less than the
>> +        number of vCPU's defined for the domain. Valid <code>iothreads</code>
>> +        values are described in the <code>iothreadids</code>
>> +        <a href="#elementsIOThreadsAllocation"><code>description</code></a>. For
> 
> <iothreadids> don't include the implicit ones that were added by
> <iothreads>, but this code should be able to set them.
> 

It can, but I'll add the following to help out (at least ranges are
described now...):

   If no <code>iothreadids</code> are defined, then libvirt numbers
   IOThreads from 1 to the number of <code>iothreads</code> available
   for the domain.

>>          real-time schedulers (<code>fifo</code>, <code>rr</code>), priority must
>>          be specified as well (and is ignored for non-real-time ones). The value
>>          range for the priority depends on the host kernel (usually 1-99).
>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>> index 969e56f..3e8551b 100644
>> --- a/src/conf/domain_conf.c
>> +++ b/src/conf/domain_conf.c
>> @@ -14313,7 +14313,7 @@ virDomainDefParseXML(xmlDocPtr xml,
>>  
>>          for (i = 0; i < def->cputune.niothreadsched; i++) {
>>              if (virDomainThreadSchedParse(nodes[i],
>> -                                          1, def->iothreads,
>> +                                          1, UINT_MAX,
>>                                            "iothreads",
>>                                            &def->cputune.iothreadsched[i]) < 0)
>>                  goto error;
>> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-toomuch.xml b/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-toomuch.xml
>> index 1540969..97a5cde 100644
>> --- a/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-toomuch.xml
>> +++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-toomuch.xml
>> @@ -13,6 +13,7 @@
>>      <vcpupin vcpu='1' cpuset='1'/>
>>      <emulatorpin cpuset='1'/>
>>      <vcpusched vcpus='0-1' scheduler='fifo' priority='1'/>
>> +    <iothreadsched iothreads='1' scheduler='batch'/>
>>      <iothreadsched iothreads='2' scheduler='batch'/>
> 
> Both lines above are equivalent to
> <iothreadsched iothreads='1-2' scheduler='batch'/>. Change the scheduler
> type if there's a reason to have two lines.
> 

OK - the reason for two lines is the "assumption" change that the
IOThreads are numbered 1..n.  The existing test would have iothread_id=2
which would fail the > iothreads (of 1) check.

The following doesn't change anything,

    <iothreadsched iothreads='1-2' scheduler='batch'/>

so, the following is needed:


-    <iothreadsched iothreads='2' scheduler='batch'/>
+    <iothreadsched iothreads='1' scheduler='batch'/>
+    <iothreadsched iothreads='2' scheduler='fifo'/>



>>    </cputune>
>>    <os>
> 
> Peter
> 




More information about the libvir-list mailing list