public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Laurent Vivier <Laurent.Vivier@bull.net>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	virtualization <virtualization@lists.linux-foundation.org>
Subject: Re: [kvm-devel] [PATCH/RFC 3/4,	second shot]Introduce "account_guest_time"
Date: Fri, 17 Aug 2007 15:59:41 +0300	[thread overview]
Message-ID: <46C59BBD.6050204@qumranet.com> (raw)
In-Reply-To: <46C58BD5.3090207@bull.net>

Laurent Vivier wrote:
> This is another way to compute guest time... I remove the "account modifiers"
> mechanism and call directly account_guest_time() from account_system_time().
> account_system_time() computes user, system and guest times according value
> accumulated in vtime (a ktime_t) in task_struct by the virtual machine.
>   


> @@ -3246,6 +3277,10 @@
>  	struct rq *rq = this_rq();
>  	cputime64_t tmp;
>  
> +#ifdef CONFIG_GUEST_ACCOUNTING
> +	cputime = account_guest_time(p, cputime);
> +#endif
> +
>  	p->stime = cputime_add(p->stime, cputime);
>  
>  	/* Add system time to cpustat. */


In order to reduce the impact on whatever function this is in (use diff
-p please), you can always have a definition of account_guest_time:

#else

static cputime_t account_guest_time(struct task_struct *p, cputime_t cputime)
{
        return cputime;
}

#endif


This way the #ifdef/#endif is not necessary when calling it.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  parent reply	other threads:[~2007-08-17 12:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <46C4719A.2060308@bull.net>
2007-08-16 15:57 ` [PATCH/RFC 1/4]Introduce a new field "guest" in cpustat Laurent Vivier
     [not found] ` <46C4720F.7030304@bull.net>
2007-08-16 15:57   ` [PATCH/RFC 2/4]Introduce a new field "guest" in task_struct Laurent Vivier
     [not found]   ` <46C4725A.4070607@bull.net>
2007-08-16 15:58     ` [PATCH/RFC 3/4]Introduce "account modifiers" mechanism Laurent Vivier
2007-08-16 22:39       ` Rusty Russell
2007-08-17  7:35         ` Laurent Vivier
2007-08-17  8:30           ` Rusty Russell
2007-08-17  9:16             ` Laurent Vivier
2007-08-17 11:51               ` [PATCH/RFC 3/4, second shot]Introduce "account_guest_time" Laurent Vivier
2007-08-17 11:54                 ` [PATCH/RFC 4/4, second shot]KVM uses "account_guest_time()" Laurent Vivier
2007-08-17 13:03                   ` [kvm-devel] " Avi Kivity
2007-08-17 13:16                     ` Laurent Vivier
2007-08-19  7:39                       ` Avi Kivity
2007-08-17 12:59                 ` Avi Kivity [this message]
2007-08-17 12:55               ` [kvm-devel] [PATCH/RFC 3/4]Introduce "account modifiers" mechanism Avi Kivity
2007-08-17 13:08                 ` Laurent Vivier
2007-08-17 13:32                   ` Christian Borntraeger
2007-08-19  7:41                   ` Avi Kivity
2007-08-17 14:12                 ` Laurent Vivier
2007-08-19  7:38                   ` Avi Kivity
2007-08-20  7:30                     ` Laurent Vivier
2007-08-20  7:55                       ` Avi Kivity
     [not found]     ` <46C472D2.7000702@bull.net>
2007-08-16 15:59       ` [PATCH/RFC 4/4]Modify KVM to use the "account modifiers" Laurent Vivier

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=46C59BBD.6050204@qumranet.com \
    --to=avi@qumranet.com \
    --cc=Laurent.Vivier@bull.net \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox