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
Author: Naoya Horiguchi <firstname.lastname@example.org>
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 <email@example.com>
Acked-by: Naoya Horiguchi <firstname.lastname@example.org>
Signed-off-by: Andi Kleen <email@example.com>
1 file changed