The following changes since commit 71339117638469372f703332d8b969382b12c49b: clock: turn expensive division into multiply + cheap division (2012-12-21 22:54:56 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master Dan Horák (1): implement get_cpu_clock() for s390/s390x Jens Axboe (2): Move 'tsc_reliable' outside of ARCH_HAVE_CPU_CLOCK gettime: even rounding, don't always round up arch/arch-s390.h | 18 ++++++++++++++++++ gettime.c | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) --- Diff of recent changes: diff --git a/arch/arch-s390.h b/arch/arch-s390.h index fe51791..bcd9163 100644 --- a/arch/arch-s390.h +++ b/arch/arch-s390.h @@ -22,4 +22,22 @@ #define read_barrier() asm volatile("bcr 15,0" : : : "memory") #define write_barrier() asm volatile("bcr 15,0" : : : "memory") +static inline unsigned long long get_cpu_clock(void) +{ + unsigned long long clk; + + __asm__ __volatile__("stck %0" : "=Q" (clk) : : "cc"); + return clk; +} + +#define ARCH_HAVE_INIT +extern int tsc_reliable; +static inline int arch_init(char *envp[]) +{ + tsc_reliable = 1; + return 0; +} + +#define ARCH_HAVE_CPU_CLOCK + #endif diff --git a/gettime.c b/gettime.c index df329f6..3011d74 100644 --- a/gettime.c +++ b/gettime.c @@ -16,8 +16,8 @@ #ifdef ARCH_HAVE_CPU_CLOCK static unsigned long cycles_per_usec; static unsigned long inv_cycles_per_usec; -int tsc_reliable = 0; #endif +int tsc_reliable = 0; struct tv_valid { struct timeval last_tv; @@ -273,7 +273,7 @@ static void calibrate_cpu_clock(void) dprint(FD_TIME, "cycles[%d]=%lu\n", i, cycles[i] / 10); avg /= samples; - avg = (avg + 9) / 10; + avg = (avg + 5) / 10; dprint(FD_TIME, "avg: %lu\n", avg); dprint(FD_TIME, "mean=%f, S=%f\n", mean, S); -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html