Displaying 20 results from an estimated 24 matches for "cycles_2_ns".
2007 Apr 18
2
[PATCH/RFC] replace get_scheduled_cycles with sched_clock paravirt_op
...not a good match for
Xen's runstate accounting, which reports everything in nanoseconds.
This patch replaces this interface with a sched_clock interface, which
matches both Xen and VMI's requirements.
In order to do this, we:
1. replace get_scheduled_cycles with sched_clock
2. hoist cycles_2_ns into a common header
3. update vmi accordingly
One thing to note: because sched_clock is implemented as a weak function in
kernel/sched.c, we must define a real function in order to override this weak
binding. This means the usual paravirt_ops technique of using an inline
function won't wo...
2007 Apr 18
2
[PATCH/RFC] replace get_scheduled_cycles with sched_clock paravirt_op
...not a good match for
Xen's runstate accounting, which reports everything in nanoseconds.
This patch replaces this interface with a sched_clock interface, which
matches both Xen and VMI's requirements.
In order to do this, we:
1. replace get_scheduled_cycles with sched_clock
2. hoist cycles_2_ns into a common header
3. update vmi accordingly
One thing to note: because sched_clock is implemented as a weak function in
kernel/sched.c, we must define a real function in order to override this weak
binding. This means the usual paravirt_ops technique of using an inline
function won't wo...
2007 Dec 04
10
[PATCH 0/10] Integrate msr.h
Hello,
This series of patches integrates msr.h header.
What it really does, is a series of steps to allow us
to get rid of duplicate code between i386 and x86_64 versions
With this done, achieving paravirt for x86_64 gets really easy,
just a couple of extra code.
The first patch was already sent a while ago, but was not yet pushed
to any tree , to my knowledge. So it is sent again. Also,
2007 Dec 04
10
[PATCH 0/10] Integrate msr.h
Hello,
This series of patches integrates msr.h header.
What it really does, is a series of steps to allow us
to get rid of duplicate code between i386 and x86_64 versions
With this done, achieving paravirt for x86_64 gets really easy,
just a couple of extra code.
The first patch was already sent a while ago, but was not yet pushed
to any tree , to my knowledge. So it is sent again. Also,
2007 Apr 18
0
[RFC, PATCH 22/24] i386 Consolidate redundant timer code
...ard, lets go shopping!"
- */
-static unsigned long cyc2ns_scale;
-#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
-
-static inline void set_cyc2ns_scale(unsigned long cpu_khz)
-{
- cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR)/cpu_khz;
-}
-
-static inline unsigned long long cycles_2_ns(unsigned long long cyc)
-{
- return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
-}
-
static unsigned long long monotonic_clock_hpet(void)
{
unsigned long long last_offset, this_offset, base;
@@ -155,6 +122,7 @@ static int __init init_hpet(char* overri
return -ENODEV;
printk("...
2007 Apr 18
0
[RFC, PATCH 22/24] i386 Consolidate redundant timer code
...ard, lets go shopping!"
- */
-static unsigned long cyc2ns_scale;
-#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
-
-static inline void set_cyc2ns_scale(unsigned long cpu_khz)
-{
- cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR)/cpu_khz;
-}
-
-static inline unsigned long long cycles_2_ns(unsigned long long cyc)
-{
- return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
-}
-
static unsigned long long monotonic_clock_hpet(void)
{
unsigned long long last_offset, this_offset, base;
@@ -155,6 +122,7 @@ static int __init init_hpet(char* overri
return -ENODEV;
printk("...
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
...all CPUs.
*/
#ifndef CONFIG_NUMA
- if (!use_tsc)
+ if (!use_sched_clock_cycles)
#endif
/* no locking but a rare wrong value is not a big deal */
return jiffies_64 * (1000000000 / HZ);
-
- /* Read the Time Stamp Counter */
- rdtscll(this_offset);
-
/* return the value in ns */
- return cycles_2_ns(this_offset);
+ return cycles_2_ns(sched_clock_cycles());
}
static void delay_tsc(unsigned long loops)
@@ -510,6 +506,7 @@ static int __init init_tsc(char* overrid
init_xtime_from_cmos();
fast_gettimeoffset_quotient = tsc_quotient;
use_tsc = 1;
+ use_sched_clock_cycles = 1;
/*...
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
...all CPUs.
*/
#ifndef CONFIG_NUMA
- if (!use_tsc)
+ if (!use_sched_clock_cycles)
#endif
/* no locking but a rare wrong value is not a big deal */
return jiffies_64 * (1000000000 / HZ);
-
- /* Read the Time Stamp Counter */
- rdtscll(this_offset);
-
/* return the value in ns */
- return cycles_2_ns(this_offset);
+ return cycles_2_ns(sched_clock_cycles());
}
static void delay_tsc(unsigned long loops)
@@ -510,6 +506,7 @@ static int __init init_tsc(char* overrid
init_xtime_from_cmos();
fast_gettimeoffset_quotient = tsc_quotient;
use_tsc = 1;
+ use_sched_clock_cycles = 1;
/*...
2007 Apr 18
0
[PATCH 3/9] Vmi cpu cycles.patch
..._tr_desc,
.set_ldt = native_set_ldt,
.load_gdt = native_load_gdt,
diff -r b8b315c897bb arch/i386/kernel/tsc.c
--- a/arch/i386/kernel/tsc.c Tue Feb 27 14:04:43 2007 -0800
+++ b/arch/i386/kernel/tsc.c Tue Feb 27 14:09:23 2007 -0800
@@ -117,7 +117,7 @@ unsigned long long sched_clock(void)
return cycles_2_ns(this_offset);
}
-static unsigned long calculate_cpu_khz(void)
+unsigned long native_calculate_cpu_khz(void)
{
unsigned long long start, end;
unsigned long count;
diff -r b8b315c897bb include/asm-i386/paravirt.h
--- a/include/asm-i386/paravirt.h Tue Feb 27 14:04:43 2007 -0800
+++ b/include/a...
2007 Apr 18
0
[PATCH 3/9] Vmi cpu cycles.patch
..._tr_desc,
.set_ldt = native_set_ldt,
.load_gdt = native_load_gdt,
diff -r b8b315c897bb arch/i386/kernel/tsc.c
--- a/arch/i386/kernel/tsc.c Tue Feb 27 14:04:43 2007 -0800
+++ b/arch/i386/kernel/tsc.c Tue Feb 27 14:09:23 2007 -0800
@@ -117,7 +117,7 @@ unsigned long long sched_clock(void)
return cycles_2_ns(this_offset);
}
-static unsigned long calculate_cpu_khz(void)
+unsigned long native_calculate_cpu_khz(void)
{
unsigned long long start, end;
unsigned long count;
diff -r b8b315c897bb include/asm-i386/paravirt.h
--- a/include/asm-i386/paravirt.h Tue Feb 27 14:04:43 2007 -0800
+++ b/include/a...
2007 Apr 18
0
[RFC/PATCH PV_OPS X86_64 13/17] paravirt_ops - time updates
...rqsave()
+ */
+ spin_lock(&rtc_lock);
+ set_wallclock(nowtime);
+ spin_unlock(&rtc_lock);
+}
/* monotonic_clock(): returns # of nanoseconds passed since time_init()
* Note: This function is required to return accurate
@@ -494,13 +498,11 @@ unsigned long long sched_clock(void)
return cycles_2_ns(a);
}
-static unsigned long get_cmos_time(void)
+unsigned long do_get_cmos_time(void)
{
unsigned int year, mon, day, hour, min, sec;
- unsigned long flags;
unsigned extyear = 0;
- spin_lock_irqsave(&rtc_lock, flags);
do {
sec = CMOS_READ(RTC_SECONDS);
@@ -516,7 +518,6 @@ static...
2007 Apr 18
0
[RFC/PATCH PV_OPS X86_64 13/17] paravirt_ops - time updates
...rqsave()
+ */
+ spin_lock(&rtc_lock);
+ set_wallclock(nowtime);
+ spin_unlock(&rtc_lock);
+}
/* monotonic_clock(): returns # of nanoseconds passed since time_init()
* Note: This function is required to return accurate
@@ -494,13 +498,11 @@ unsigned long long sched_clock(void)
return cycles_2_ns(a);
}
-static unsigned long get_cmos_time(void)
+unsigned long do_get_cmos_time(void)
{
unsigned int year, mon, day, hour, min, sec;
- unsigned long flags;
unsigned extyear = 0;
- spin_lock_irqsave(&rtc_lock, flags);
do {
sec = CMOS_READ(RTC_SECONDS);
@@ -516,7 +518,6 @@ static...
2007 Apr 18
1
[PATCH 2/9] Sched clock paravirt op fix.patch
...if there's no TSC available:
*/
@@ -119,7 +117,7 @@ unsigned long long sched_clock(void)
return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);
/* read the Time Stamp Counter: */
- rdtscll(this_offset);
+ get_scheduled_cycles(this_offset);
/* return the value in ns */
return cycles_2_ns(this_offset);
diff -r d58e6ddfdfa9 arch/i386/kernel/vmi.c
--- a/arch/i386/kernel/vmi.c Thu Feb 15 23:52:41 2007 -0800
+++ b/arch/i386/kernel/vmi.c Fri Feb 16 00:02:48 2007 -0800
@@ -873,7 +873,7 @@ static inline int __init activate_vmi(vo
paravirt_ops.setup_boot_clock = vmi_timer_setup_boot_alar...
2007 Apr 18
1
[PATCH 2/9] Sched clock paravirt op fix.patch
...if there's no TSC available:
*/
@@ -119,7 +117,7 @@ unsigned long long sched_clock(void)
return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);
/* read the Time Stamp Counter: */
- rdtscll(this_offset);
+ get_scheduled_cycles(this_offset);
/* return the value in ns */
return cycles_2_ns(this_offset);
diff -r d58e6ddfdfa9 arch/i386/kernel/vmi.c
--- a/arch/i386/kernel/vmi.c Thu Feb 15 23:52:41 2007 -0800
+++ b/arch/i386/kernel/vmi.c Fri Feb 16 00:02:48 2007 -0800
@@ -873,7 +873,7 @@ static inline int __init activate_vmi(vo
paravirt_ops.setup_boot_clock = vmi_timer_setup_boot_alar...
2007 Apr 18
23
[patch 00/20] paravirt_ops updates
Hi Andi,
Here's a repost of the paravirt_ops update series I posted the other day.
Since then, I found a few potential bugs with patching clobbering,
cleaned up and documented paravirt.h and the patching machinery.
Overview:
add-MAINTAINERS.patch
obvious
remove-CONFIG_DEBUG_PARAVIRT.patch
No longer meaningful or needed.
paravirt-nop.patch
Clean up nop paravirt_ops functions, mainly to
2007 Apr 18
23
[patch 00/20] paravirt_ops updates
Hi Andi,
Here's a repost of the paravirt_ops update series I posted the other day.
Since then, I found a few potential bugs with patching clobbering,
cleaned up and documented paravirt.h and the patching machinery.
Overview:
add-MAINTAINERS.patch
obvious
remove-CONFIG_DEBUG_PARAVIRT.patch
No longer meaningful or needed.
paravirt-nop.patch
Clean up nop paravirt_ops functions, mainly to
2007 Apr 18
31
[PATCH 00/28] Updates for firstfloor paravirt-ops patches
Hi Andi,
This is a set of updates for the firstfloor patch queue.
Quick rundown:
revert-mm-x86_64-mm-account-for-module-percpu-space-separately-from-kernel-percpu.patch
separate-module-percpu-space.patch
Update the module percpu accounting patch
fix-ff-allow-percpu-variables-to-be-page-aligned.patch
Make sure the percpu memory allocation is page-aligned
2007 Apr 18
31
[PATCH 00/28] Updates for firstfloor paravirt-ops patches
Hi Andi,
This is a set of updates for the firstfloor patch queue.
Quick rundown:
revert-mm-x86_64-mm-account-for-module-percpu-space-separately-from-kernel-percpu.patch
separate-module-percpu-space.patch
Update the module percpu accounting patch
fix-ff-allow-percpu-variables-to-be-page-aligned.patch
Make sure the percpu memory allocation is page-aligned
2007 Apr 18
17
[patch 00/17] paravirt_ops updates
Hi Andi,
This series of patches updates paravirt_ops in various ways. Some of the
changes are plain cleanups and improvements, and some add some interfaces
necessary for Xen.
The brief overview:
add-MAINTAINERS.patch - obvious
remove-CONFIG_DEBUG_PARAVIRT.patch - no longer needed
paravirt-nop.patch - mark nop operations consistently
paravirt-pte-accessors.patch - operations to pack/unpack
2007 Apr 18
17
[patch 00/17] paravirt_ops updates
Hi Andi,
This series of patches updates paravirt_ops in various ways. Some of the
changes are plain cleanups and improvements, and some add some interfaces
necessary for Xen.
The brief overview:
add-MAINTAINERS.patch - obvious
remove-CONFIG_DEBUG_PARAVIRT.patch - no longer needed
paravirt-nop.patch - mark nop operations consistently
paravirt-pte-accessors.patch - operations to pack/unpack