lkml.org 
[lkml]   [2011]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 5/6] KVM-GST: adjust scheduler cpu power
From
Date
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 per tick.
>
> > But all the rest
> > here, that is behind the hypervisor specific vs generic code has nothing
> > to do with ticks at all.
>
> But I don't get it, there is no generic code needed, all that's needed
> is u64 steal_time_clock(int cpu), and the first part of your
> kvm_account_steal_time() function is exactly that if you add the cpu
> argument.
>
> +static u64 steal_time_clock(int cpu)
> +{
> + u64 steal_time;
> + struct kvm_steal_time *src;
> + int version;
> +
> + preempt_disable();
> + src = &per_cpu_ptr(steal_time, cpu);
> + do {
> + version = src->version;
> + rmb();
> + steal_time = src->steal;
> + rmb();
> + } while ((src->version & 1) || (version != src->version));
> + preempt_enable();
> +
> + return steal_time
> +}
>
> And you're done.. no need to for any of that steal_time_{read,write} business.

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. One option is to
call update_rq_clock_task from inside kvm-code, but I don't really like
it very much.

But okay, there are many ways to work around it, I'll cook something.



\
 
 \ /
  Last update: 2011-02-01 20:59    [W:0.066 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site