Re: nice value is ignored on cpu time accounting of a guest?

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

 



On Tue, Oct 20, 2009 at 4:17 PM, Avi Kivity <avi@xxxxxxxxxx> wrote:
> On 10/20/2009 04:06 PM, Ryota Ozaki wrote:
>>>
>>> Looks like we need to add a separate guest_nice, or get rid of guest time
>>> altogether.
>>>
>>
>> Hmm, guest time is already exposed via /proc/stat so adding guest_nice is
>> better
>> if fix here? I don't know anyone utilize 'guest' value though.
>>
>
> No one uses guest time to my knowledge.  However, we can't be sure, so it's
> better to add guest_nice.
>
> Note you need to add guest_nice to user_nice, so old tools see it as nice
> time (same as guest_time now).

Well, like this?

        /* Add user time to cpustat. */
        tmp = cputime_to_cputime64(cputime);
        if (TASK_NICE(p) > 0) {
                cpustat->nice = cputime64_add(cpustat->nice, tmp);
                cpustat->guest_nice = cputime64_add(cpustat->guest_nice, tmp);
        } else {
                cpustat->user = cputime64_add(cpustat->user, tmp);
                cpustat->guest = cputime64_add(cpustat->guest, tmp);
        }

  ozaki-r
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux