Skip to content
Snippets Groups Projects
Commit 2a98e82a authored by Liu Shixin's avatar Liu Shixin Committed by Yongqiang Liu
Browse files

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: default avatarLiu Shixin <liushixin2@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 5ac69702
No related branches found
No related tags found
No related merge requests found
......@@ -4726,11 +4726,9 @@ static int clear_gigantic_page_chunk(unsigned long start, unsigned long end,
unsigned long i;
might_sleep();
for (i = start; i < end; ++i) {
for (i = start; i < end; i++, p = mem_map_next(p, base_page, i)) {
cond_resched();
clear_user_highpage(p, addr + i * PAGE_SIZE);
p = mem_map_next(p, base_page, i);
}
return KTASK_RETURN_SUCCESS;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment