public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <Laurent.Vivier@bull.net>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>,
	Ingo Molnar <mingo@elte.hu>,
	virtualization <virtualization@lists.linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH/RFC 3/4]Introduce "account modifiers" mechanism
Date: Fri, 17 Aug 2007 09:35:20 +0200	[thread overview]
Message-ID: <46C54FB8.7050504@bull.net> (raw)
In-Reply-To: <1187303955.6449.7.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2110 bytes --]

Rusty Russell wrote:
> On Thu, 2007-08-16 at 17:58 +0200, Laurent Vivier wrote:
>> [PATCH 3/3] introduce "account modifiers" mechanism in the kernel allowing a
>> module to modify the collected accounting for a given task. This implementation
>> is based on the "preempt_notifier". "account_system_time()" and
>> "account_user_time()" can call functions registered by a module to modify the
>> cputime value.
>>
>> Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
> 
> 
> Hi Laurent,

Hi Rusty,
how are your puppies ?
And thank you for your comment.

> 	This seems a little like overkill.  Why not just add an
> "account_guest_time" which subtracts the given amount of time from
> system time (if available) and adds it to guest time?  Then kvm (and
> lguest) should just need to call this at the right times.

We can. I did something like this before.
By doing like that, I think there is a major issue: system time can be
decreasing (as we substract a value from it), and thus we can have negative
value in a tool like top. It's why I play with the cputime to add to system time
and not directly with the system time.

BUT I'm very open, my only goal is be able to compute guest time, "how" is not
very important...

what we can do:

- keep PATCHES 1 and 2, because we need to store guest time for cpu and tasks.
It is very generic.

- remove PATCH 3, and add in task_struct a "ktime vtime" where we accumulate
guest time (by calling something like guest_enter() and guest_exit() from the
virtualization engine), and when in account_system_time() we have cputime >
vtime we substrate vtime from cputime and add vtime to user time and guest time.
But doing like this we freeze in kernel/sched.c the link between system time,
user time and guest time (i.e. system time = system time - vtime, user time =
user time + vtime and guest time = guest time + vtime).

- modify PATCH 4 to use new PATCH 3.

Do you agree ? Anybody doesn't agree ?

Laurent
-- 
------------- Laurent.Vivier@bull.net  --------------
          "Software is hard" - Donald Knuth


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-08-17  7:35 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 [this message]
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                 ` [kvm-devel] [PATCH/RFC 3/4, second shot]Introduce "account_guest_time" Avi Kivity
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=46C54FB8.7050504@bull.net \
    --to=laurent.vivier@bull.net \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --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