projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Align io units to processor cache line size
[fio.git]
/
os
/
os.h
diff --git
a/os/os.h
b/os/os.h
index 5a3bc559186a2c076635a91c6cf85c72a9b80211..dbf095711c08344e054966512dae3f41d8c75280 100644
(file)
--- 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
}
#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
#endif