All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Ryota Ozaki <ozaki.ryota@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: nice value is ignored on cpu time accounting of a guest?
Date: Tue, 20 Oct 2009 16:34:42 +0900	[thread overview]
Message-ID: <4ADD6812.3050900@redhat.com> (raw)
In-Reply-To: <5e93dcec0910200027g30104446naa9214a2f8beda9a@mail.gmail.com>

On 10/20/2009 04:27 PM, Ryota Ozaki wrote:
> On Tue, Oct 20, 2009 at 4:17 PM, Avi Kivity<avi@redhat.com>  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);
>          }
>    

In account_guest_time()?  Yes.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


  reply	other threads:[~2009-10-20  7:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19  9:46 nice value is ignored on cpu time accounting of a guest? Ryota Ozaki
2009-10-20  5:21 ` Avi Kivity
2009-10-20  7:06   ` Ryota Ozaki
2009-10-20  7:17     ` Avi Kivity
2009-10-20  7:27       ` Ryota Ozaki
2009-10-20  7:34         ` Avi Kivity [this message]
2009-10-20  7:38           ` Ryota Ozaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ADD6812.3050900@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=ozaki.ryota@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.