Skip to content

Commit

Permalink
Fixes: #1210 hugetlb parameter causes problem on Centos and since
Browse files Browse the repository at this point in the history
memory is already mapped on hugetlbfs and with mlock, there is no
need to explicitly use hugetlb parameter
(See comment: #1210 (comment))
  • Loading branch information
kullanici0606 committed Jul 31, 2018
1 parent 732eae9 commit 73de63b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/memory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ function allocate_huge_page (size, persistent)
local fd = syscall.open(tmpfile, "creat, rdwr", "RWXU")
assert(fd, "create hugetlb")
assert(syscall.ftruncate(fd, size), "ftruncate")
local tmpptr = syscall.mmap(nil, size, "read, write", "shared, hugetlb", fd, 0)
local tmpptr = syscall.mmap(nil, size, "read, write", "shared", fd, 0)
assert(tmpptr, "mmap hugetlb")
assert(syscall.mlock(tmpptr, size))
local phys = resolve_physical(tmpptr)
local virt = bit.bor(phys, tag)
local ptr = syscall.mmap(virt, size, "read, write", "shared, hugetlb, fixed", fd, 0)
local ptr = syscall.mmap(virt, size, "read, write", "shared, fixed", fd, 0)
local filename = ("/var/run/snabb/hugetlbfs/%012x.dma"):format(tonumber(phys))
if persistent then
assert(syscall.rename(tmpfile, filename))
Expand Down

0 comments on commit 73de63b

Please sign in to comment.