aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJin Dongming <jin.dongming@np.css.fujitsu.com>2010-11-24 15:37:11 +0900
committerAndi Kleen <ak@linux.intel.com>2010-11-24 11:35:39 +0100
commit9d10506c1149079cea6be266014fc4af6d0850d2 (patch)
treed9f1d2493f86e14e0a3ae3013606655973643e33
parent717a2621b5103b90f2028137c2964f7a3acac8ba (diff)
downloadmce-test-9d10506c1149079cea6be266014fc4af6d0850d2.tar.gz
Fix write/read_hugepage() for copy-on-write.
When the cowflag is valid, child process should copy all the hugepage of its parent. But now no matter what cowflag is, the child process will not do copy-on-write operation. It is because the parameter(size==0) of write_hugepage() make write_hugepage() do nothing. This problem is introduced by commit c6a4c3d950385063db705e520bc9b6cda9587f57 Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> With this patch, the state of parent and child processes will be like following: Before this patch After this patch NO-COW Parent and child processes are killed. Same as before. COW Parent and child processes are killed. Only parent process is killed. (Here process is killed by memory-failure.) Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com> Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r--tsrc/thugetlb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tsrc/thugetlb.c b/tsrc/thugetlb.c
index 28a1f10..0f07a6a 100644
--- a/tsrc/thugetlb.c
+++ b/tsrc/thugetlb.c
@@ -259,8 +259,8 @@ int main(int argc, char *argv[])
if (!pid) {
/* Semaphore is already held */
if (cowflag) {
- write_hugepage(addr, 0, expected_addr);
- read_hugepage(addr, 0, expected_addr);
+ write_hugepage(addr, file_size, 0);
+ read_hugepage(addr, file_size, 0);
}
if (put_semaphore(semid, &sembuffer))
err("put_semaphore");