提交 2a98e82a 编写于 作者: L Liu Shixin 提交者: Yongqiang Liu

mm/memory.c: fix clear_gigantic_page_chunk

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5323R
CVE: NA

--------------------------------

Patch "mm: parallelize clear_gigantic_page" put mem_map_next() after
clear_user_highpage but not modify the parameter i. So it's actually the
previous page being cleared in each loop. As a result, the last page has
not been cleared. Fix it by put mem_map_next() back to the original
position.

Fixes: ae0cd4d4 ("mm: parallelize clear_gigantic_page")
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 5ac69702
...@@ -4726,11 +4726,9 @@ static int clear_gigantic_page_chunk(unsigned long start, unsigned long end, ...@@ -4726,11 +4726,9 @@ static int clear_gigantic_page_chunk(unsigned long start, unsigned long end,
unsigned long i; unsigned long i;
might_sleep(); might_sleep();
for (i = start; i < end; ++i) { for (i = start; i < end; i++, p = mem_map_next(p, base_page, i)) {
cond_resched(); cond_resched();
clear_user_highpage(p, addr + i * PAGE_SIZE); clear_user_highpage(p, addr + i * PAGE_SIZE);
p = mem_map_next(p, base_page, i);
} }
return KTASK_RETURN_SUCCESS; return KTASK_RETURN_SUCCESS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册