Recent changes (master)
The following changes since commit 9af4af7ab40c4e505033d0e077cc42ac84996b09:
ci: fix macOS sphinx install issues (2024-02-22 20:01:27 -0500)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to 5ae4f4220a48dddddc84c8b839ef9d8a1ed4edb1:
gettime: fix cpuclock-test on AMD platforms (2024-02-27 12:36:45 -0500)
----------------------------------------------------------------
Vincent Fu (2):
howto: fix job_start_clock_id formatting
gettime: fix cpuclock-test on AMD platforms
HOWTO.rst | 5 +++-- arch/arch-x86_64.h | 5 +++++ arch/arch.h | 7 +++++++ gettime.c | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-)
---
Diff of recent changes:
HOWTO.rst +3 -2
@@ -756,8 +756,9 @@ Time related parameters CPU mask of other jobs. .. option:: job_start_clock_id=int - The clock_id passed to the call to `clock_gettime` used to record job_start - in the `json` output format. Default is 0, or CLOCK_REALTIME. + + The clock_id passed to the call to `clock_gettime` used to record + job_start in the `json` output format. Default is 0, or CLOCK_REALTIME. Target file/device
arch/arch-x86_64.h +5 -0
@@ -26,6 +26,11 @@ static inline unsigned long arch_ffz(unsigned long bitmask)return bitmask; } +static inline void tsc_barrier (void ) +{ + __asm__ __volatile__("mfence" :::"memory" ); +} +static inline unsigned long long get_cpu_clock (void ) {unsigned int lo, hi;
arch/arch.h +7 -0
@@ -108,6 +108,13 @@ extern unsigned long arch_flags;#include "arch-generic.h" #endif +#if !defined(__x86_64__) && defined(CONFIG_SYNC_SYNC ) +static inline void tsc_barrier (void ) +{ +__sync_synchronize (); +} +#endif +#include "../lib/ffz.h" /* IWYU pragma: end_exports */
gettime.c +1 -1
@@ -623,7 +623,7 @@ static void *clock_thread_fn(void *data) seq = *t->seq;if (seq ==UINT_MAX )break ; -__sync_synchronize (); +tsc_barrier (); tsc =get_cpu_clock (); }while (seq !=atomic32_compare_and_swap (t->seq, seq, seq +1 ));