projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
[fio.git]
/
fio.c
diff --git
a/fio.c
b/fio.c
index ff77c91bb77f8968b4cf0807635b53256c504e0f..f0665e072ccbd5f6ac3f4dcd52a5edfe015cbf31 100644
(file)
--- a/
fio.c
+++ b/
fio.c
@@
-733,7
+733,7
@@
static int init_io_u(struct thread_data *td)
{
struct io_u *io_u;
unsigned int max_bs;
{
struct io_u *io_u;
unsigned int max_bs;
- int i, max_units;
+ int
cl_align,
i, max_units;
char *p;
max_units = td->o.iodepth;
char *p;
max_units = td->o.iodepth;
@@
-761,10
+761,20
@@
static int init_io_u(struct thread_data *td)
else
p = td->orig_buffer;
else
p = td->orig_buffer;
+ cl_align = os_cache_line_size();
+
for (i = 0; i < max_units; i++) {
for (i = 0; i < max_units; i++) {
+ void *ptr;
+
if (td->terminate)
return 1;
if (td->terminate)
return 1;
- io_u = malloc(sizeof(*io_u));
+
+ if (posix_memalign(&ptr, cl_align, sizeof(*io_u))) {
+ log_err("fio: posix_memalign=%s\n", strerror(errno));
+ break;
+ }
+
+ io_u = ptr;
memset(io_u, 0, sizeof(*io_u));
INIT_FLIST_HEAD(&io_u->list);
memset(io_u, 0, sizeof(*io_u));
INIT_FLIST_HEAD(&io_u->list);