Re: [patch 17/17] Add a sched_clock paravirt_op

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andi Kleen <ak@...>
Cc: Andrew Morton <akpm@...>, <virtualization@...>, lkml <linux-kernel@...>, Zachary Amsden <zach@...>, Dan Hecht <dhecht@...>, john stultz <johnstul@...>
Date: Monday, April 2, 2007 - 3:06 am

Andi Kleen wrote:

What you actually get is how many ns the CPU spent in each state. 
Stolen is runnable+offline.


It just seems like a simpler interface to just allow overriding
sched_clock, rather than exposing sched_clock's internals and fiddling
with those.  There's really nothing in the existing sched_clock which
can be profitably reused in the Xen case.  VMI can make use of the
cycles_2_ns conversion, which is why I made it available for its use.

To be specific, this is the whole Xen sched_clock function:

/* Xen sched_clock implementation.  Returns the number of RUNNING ns */
unsigned long long xen_sched_clock(void)
{
	struct vcpu_runstate_info state;
	cycle_t now;
	unsigned long long ret;

	preempt_disable();

	now = xen_clocksource_read();
	get_runstate_snapshot(&state);
	WARN_ON(state.state != RUNSTATE_running);

	ret = state.time[RUNSTATE_running] + (now - state.state_entry_time);

	preempt_enable();

	return ret;
}


    J
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 17/17] Add a sched_clock paravirt_op, Jeremy Fitzhardinge, (Mon Apr 2, 1:57 am)
Re: [patch 17/17] Add a sched_clock paravirt_op, Andi Kleen, (Mon Apr 2, 2:09 am)
Re: [patch 17/17] Add a sched_clock paravirt_op, Jeremy Fitzhardinge, (Mon Apr 2, 2:47 am)
Re: [patch 17/17] Add a sched_clock paravirt_op, Andi Kleen, (Mon Apr 2, 2:50 am)
Re: [patch 17/17] Add a sched_clock paravirt_op, Jeremy Fitzhardinge, (Mon Apr 2, 3:06 am)