Re: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-02-01 Thread Glauber Costa
On Mon, 2011-01-31 at 12:25 +0100, Peter Zijlstra wrote: On Fri, 2011-01-28 at 14:52 -0500, Glauber Costa wrote: +#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING +static DEFINE_PER_CPU(u64, cpu_steal_time); + +#ifndef CONFIG_64BIT +static DEFINE_PER_CPU(seqcount_t, steal_time_seq); +

Re: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-02-01 Thread Peter Zijlstra
On Tue, 2011-02-01 at 13:59 -0200, Glauber Costa wrote: Because that part is kvm-specific, and this is scheduler general. It seemed cleaner to me to do it this way. But I can do it differently, certainly. Well, any steal time clock will be hypervisor specific, but if we agree that anything

Re: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-02-01 Thread Glauber Costa
On Tue, 2011-02-01 at 17:19 +0100, Peter Zijlstra wrote: On Tue, 2011-02-01 at 13:59 -0200, Glauber Costa wrote: Because that part is kvm-specific, and this is scheduler general. It seemed cleaner to me to do it this way. But I can do it differently, certainly. Well, any steal time

Re: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-02-01 Thread Peter Zijlstra
On Tue, 2011-02-01 at 14:22 -0200, Glauber Costa wrote: Which tick accounting? In your other e-mail , you pointed that this only runs in touch_steal_time, which is fine, will change. That tick ;-), all the account_foo muck is per tick. But all the rest here, that is behind the

Re: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-02-01 Thread Glauber Costa
On Tue, 2011-02-01 at 19:59 +0100, Peter Zijlstra wrote: On Tue, 2011-02-01 at 14:22 -0200, Glauber Costa wrote: Which tick accounting? In your other e-mail , you pointed that this only runs in touch_steal_time, which is fine, will change. That tick ;-), all the account_foo muck is

Re: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-02-01 Thread Peter Zijlstra
On Tue, 2011-02-01 at 17:55 -0200, Glauber Costa wrote: update_rq_clock_task still have to keep track of what was the last steal time value we saw, in the same way it does for irq. Right, the CONFIG_SCHED_PARAVIRT patch I sent earlier adds a prev_steal_time member to struct rq for this

Re: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-01-31 Thread Peter Zijlstra
On Fri, 2011-01-28 at 14:52 -0500, Glauber Costa wrote: +#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING +static DEFINE_PER_CPU(u64, cpu_steal_time); + +#ifndef CONFIG_64BIT +static DEFINE_PER_CPU(seqcount_t, steal_time_seq); + +static inline void steal_time_write_begin(void) +{ +

Re: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-01-31 Thread Peter Zijlstra
On Mon, 2011-01-31 at 12:25 +0100, Peter Zijlstra wrote: On Fri, 2011-01-28 at 14:52 -0500, Glauber Costa wrote: +#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING +static DEFINE_PER_CPU(u64, cpu_steal_time); + +#ifndef CONFIG_64BIT +static DEFINE_PER_CPU(seqcount_t, steal_time_seq); +

[PATCH v2 5/6] KVM-GST: adjust scheduler cpu power

2011-01-28 Thread Glauber Costa
This is a first proposal for using steal time information to influence the scheduler. There are a lot of optimizations and fine grained adjustments to be done, but it is working reasonably so far for me (mostly) With this patch (and some host pinnings to demonstrate the situation), two vcpus with