Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/flavono123/LKFES
Browse files Browse the repository at this point in the history
  • Loading branch information
wrlawodms committed Nov 21, 2016
2 parents 1446120 + d5722e8 commit 22b817a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions feature-evals/madv_free/ebizzy_madv.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,16 @@ alloc_mem(size_t size)
err = 1;
}

if (madv_flag)
syscall(__NR_madvise, p, size, MADV_FREE);
else
syscall(__NR_madvise, p, size, MADV_DONTNEED);

if (err) {
if (size > 4096) {
memset(p, 1, size);

if (madv_flag)
madvise(p, size, MADV_FREE);
else
madvise(p, size, MADV_DONTNEED);
}

if (err) {
fprintf(stderr, "Couldn't allocate %zu bytes, try smaller "
"chunks or size options\n"
"Using -n %u chunks and -s %u size\n",
Expand Down
2 changes: 1 addition & 1 deletion feature-evals/madv_free/test_dontneed.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def exec_cmd(cmd):
stderr=subprocess.PIPE)

def set_cmd(flag):
cmd = "./ebizzy_madv -S 10 -n 512"
cmd = "./ebizzy_madv -S 10 -n 512 -m"
if flag == "MADV_FREE":
cmd += " -f"
return cmd
Expand Down
2 changes: 1 addition & 1 deletion feature-evals/madv_free/test_free.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def exec_cmd(cmd):
stderr=subprocess.PIPE)

def set_cmd(flag):
cmd = "./ebizzy_madv -S 10 -n 512"
cmd = "./ebizzy_madv -S 10 -n 512 -m"
if flag == "MADV_FREE":
cmd += " -f"
return cmd
Expand Down

0 comments on commit 22b817a

Please sign in to comment.