projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
0b9d69e
)
Make sure shmhuge allocations are huge page size aligned
author
Jens Axboe
<jens.axboe@oracle.com>
Sat, 12 Sep 2009 19:33:51 +0000
(21:33 +0200)
committer
Jens Axboe
<jens.axboe@oracle.com>
Sat, 12 Sep 2009 19:33:51 +0000
(21:33 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
memory.c
patch
|
blob
|
blame
|
history
diff --git
a/memory.c
b/memory.c
index 9b49d3986fc78584743cc4e047cd11cdfdd7e4ac..5285c0a5d416cf2eb40dd5f0698d90927ddf05fb 100644
(file)
--- a/
memory.c
+++ b/
memory.c
@@
-65,8
+65,12
@@
static int alloc_mem_shm(struct thread_data *td, unsigned int total_mem)
{
int flags = IPC_CREAT | SHM_R | SHM_W;
- if (td->o.mem_type == MEM_SHMHUGE)
+ if (td->o.mem_type == MEM_SHMHUGE) {
+ unsigned long mask = td->o.hugepage_size - 1;
+
flags |= SHM_HUGETLB;
+ total_mem = (total_mem + mask) & ~mask;
+ }
td->shm_id = shmget(IPC_PRIVATE, total_mem, flags);
dprint(FD_MEM, "shmget %u, %d\n", total_mem, td->shm_id);