Re: [PATCH] virtual sched_clock() for s390

2007-07-23 Thread Martin Schwidefsky
On Mon, 2007-07-23 at 09:15 +, Jan Glauber wrote: > > > As with s390, 64-bit PowerPC also uses CONFIG_VIRT_CPU_ACCOUNTING. > > > That affects how tsk->utime and tsk->stime are accumulated (we call > > > account_user_time and account_system_time directly rather than calling > > >

Re: [PATCH] virtual sched_clock() for s390

2007-07-23 Thread Jan Glauber
On Fri, 2007-07-20 at 09:22 +0200, Ingo Molnar wrote: > * Paul Mackerras <[EMAIL PROTECTED]> wrote: > > As with s390, 64-bit PowerPC also uses CONFIG_VIRT_CPU_ACCOUNTING. > > That affects how tsk->utime and tsk->stime are accumulated (we call > > account_user_time and account_system_time

Re: [PATCH] virtual sched_clock() for s390

2007-07-23 Thread Jan Glauber
On Fri, 2007-07-20 at 09:22 +0200, Ingo Molnar wrote: * Paul Mackerras [EMAIL PROTECTED] wrote: As with s390, 64-bit PowerPC also uses CONFIG_VIRT_CPU_ACCOUNTING. That affects how tsk-utime and tsk-stime are accumulated (we call account_user_time and account_system_time directly rather

Re: [PATCH] virtual sched_clock() for s390

2007-07-23 Thread Martin Schwidefsky
On Mon, 2007-07-23 at 09:15 +, Jan Glauber wrote: As with s390, 64-bit PowerPC also uses CONFIG_VIRT_CPU_ACCOUNTING. That affects how tsk-utime and tsk-stime are accumulated (we call account_user_time and account_system_time directly rather than calling update_process_times) as

Re: [PATCH] virtual sched_clock() for s390

2007-07-20 Thread Ingo Molnar
* Paul Mackerras <[EMAIL PROTECTED]> wrote: > PowerPC's sched_clock() currently measures real time. On POWER5 and > POWER6 machines we could change it to use a register called the "PURR" > (for Processor Utilization of Resources Register), which only measures > time spent while the partition

Re: [PATCH] virtual sched_clock() for s390

2007-07-20 Thread Jeremy Fitzhardinge
Paul Mackerras wrote: > Do you think this makes the PURR more useful for CFS, or less? To me > it looks like this would mean that CFS can make a more equitable > distribution of CPU time if, for example, you had 3 runnable tasks on > a 2-core x dual-threaded machine (4 virtual CPUs). > Sounds

Re: [PATCH] virtual sched_clock() for s390

2007-07-20 Thread Jeremy Fitzhardinge
Paul Mackerras wrote: Do you think this makes the PURR more useful for CFS, or less? To me it looks like this would mean that CFS can make a more equitable distribution of CPU time if, for example, you had 3 runnable tasks on a 2-core x dual-threaded machine (4 virtual CPUs). Sounds

Re: [PATCH] virtual sched_clock() for s390

2007-07-20 Thread Ingo Molnar
* Paul Mackerras [EMAIL PROTECTED] wrote: PowerPC's sched_clock() currently measures real time. On POWER5 and POWER6 machines we could change it to use a register called the PURR (for Processor Utilization of Resources Register), which only measures time spent while the partition is

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Paul Mackerras
Ingo Molnar writes: > CFS does measure time elapsed across task-sleep periods (and does > something similar to what the old scheduler's 'sleep average' > interactivity mechanism did), but that mechanism measures "time spent > running during sleep", not "time spent idling". PowerPC's

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Jan Glauber
On Thu, 2007-07-19 at 21:38 +0200, Ingo Molnar wrote: > * Jan Glauber <[EMAIL PROTECTED]> wrote: > > > > still, CFS needs time measurement across idle periods as well, for > > > another purpose: to be able to do precise task statistics for /proc. > > > (for top, ps, etc.) So it's still true

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Ingo Molnar
* Jan Glauber <[EMAIL PROTECTED]> wrote: > > still, CFS needs time measurement across idle periods as well, for > > another purpose: to be able to do precise task statistics for /proc. > > (for top, ps, etc.) So it's still true that sched_clock() should > > include idle periods too. > > I'm

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Jan Glauber
On Thu, 2007-07-19 at 18:00 +0200, Ingo Molnar wrote: > * Jeremy Fitzhardinge <[EMAIL PROTECTED]> wrote: > > > > /* > > > - * Monotonic_clock - returns # of nanoseconds passed since time_init() > > > + * Scheduler clock - returns current time in nanosec units. > > > + * Now based on virtual cpu

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Ingo Molnar
* Jeremy Fitzhardinge <[EMAIL PROTECTED]> wrote: > > /* > > - * Monotonic_clock - returns # of nanoseconds passed since time_init() > > + * Scheduler clock - returns current time in nanosec units. > > + * Now based on virtual cpu time to only account time the guest > > + * was actually running.

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Srivatsa Vaddagiri
On Thu, Jul 19, 2007 at 08:29:06AM -0700, Jeremy Fitzhardinge wrote: > > - * Monotonic_clock - returns # of nanoseconds passed since time_init() > > + * Scheduler clock - returns current time in nanosec units. > > + * Now based on virtual cpu time to only account time the guest > > + * was

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Jeremy Fitzhardinge
Jan Glauber wrote: > This patch introduces a cpu time clock for s390 (only ticking > if the virtual cpu is running) and bases the s390 implementation > of sched_clock() on it. > > The times lice length on a virtual cpu can be anything > between the calculated time slice and zero. In reality > this

[PATCH] virtual sched_clock() for s390

2007-07-19 Thread Jan Glauber
This patch introduces a cpu time clock for s390 (only ticking if the virtual cpu is running) and bases the s390 implementation of sched_clock() on it. The times lice length on a virtual cpu can be anything between the calculated time slice and zero. In reality this doesn't seem to be problem,

[PATCH] virtual sched_clock() for s390

2007-07-19 Thread Jan Glauber
This patch introduces a cpu time clock for s390 (only ticking if the virtual cpu is running) and bases the s390 implementation of sched_clock() on it. The times lice length on a virtual cpu can be anything between the calculated time slice and zero. In reality this doesn't seem to be problem,

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Jeremy Fitzhardinge
Jan Glauber wrote: This patch introduces a cpu time clock for s390 (only ticking if the virtual cpu is running) and bases the s390 implementation of sched_clock() on it. The times lice length on a virtual cpu can be anything between the calculated time slice and zero. In reality this

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Srivatsa Vaddagiri
On Thu, Jul 19, 2007 at 08:29:06AM -0700, Jeremy Fitzhardinge wrote: - * Monotonic_clock - returns # of nanoseconds passed since time_init() + * Scheduler clock - returns current time in nanosec units. + * Now based on virtual cpu time to only account time the guest + * was actually

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Ingo Molnar
* Jeremy Fitzhardinge [EMAIL PROTECTED] wrote: /* - * Monotonic_clock - returns # of nanoseconds passed since time_init() + * Scheduler clock - returns current time in nanosec units. + * Now based on virtual cpu time to only account time the guest + * was actually running.

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Jan Glauber
On Thu, 2007-07-19 at 18:00 +0200, Ingo Molnar wrote: * Jeremy Fitzhardinge [EMAIL PROTECTED] wrote: /* - * Monotonic_clock - returns # of nanoseconds passed since time_init() + * Scheduler clock - returns current time in nanosec units. + * Now based on virtual cpu time to only

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Ingo Molnar
* Jan Glauber [EMAIL PROTECTED] wrote: still, CFS needs time measurement across idle periods as well, for another purpose: to be able to do precise task statistics for /proc. (for top, ps, etc.) So it's still true that sched_clock() should include idle periods too. I'm not sure,

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Jan Glauber
On Thu, 2007-07-19 at 21:38 +0200, Ingo Molnar wrote: * Jan Glauber [EMAIL PROTECTED] wrote: still, CFS needs time measurement across idle periods as well, for another purpose: to be able to do precise task statistics for /proc. (for top, ps, etc.) So it's still true that

Re: [PATCH] virtual sched_clock() for s390

2007-07-19 Thread Paul Mackerras
Ingo Molnar writes: CFS does measure time elapsed across task-sleep periods (and does something similar to what the old scheduler's 'sleep average' interactivity mechanism did), but that mechanism measures time spent running during sleep, not time spent idling. PowerPC's sched_clock()