X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os%2Fos.h;h=dbf095711c08344e054966512dae3f41d8c75280;hp=5a3bc559186a2c076635a91c6cf85c72a9b80211;hb=eb7ccf38bf2e9208b593d021c50e9ad2ec0781ea;hpb=c311cd2a9e3ca77f4d2cb2f6dd8bd08185e8c0f6 diff --git a/os/os.h b/os/os.h index 5a3bc559..dbf09571 100644 --- a/os/os.h +++ b/os/os.h @@ -90,4 +90,20 @@ static inline int load_blktrace(struct thread_data *td, const char *fname) } #endif +#define FIO_DEF_CL_SIZE 128 + +static inline int os_cache_line_size(void) +{ +#ifdef FIO_HAVE_CL_SIZE + int ret = arch_cache_line_size(); + + if (ret <= 0) + return FIO_DEF_CL_SIZE; + + return ret; +#else + return FIO_DEF_CL_SIZE; +#endif +} + #endif