未验证 提交 d57eaffd 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!1374 etmem: fix the div 0 problem in swapcache reclaim process

Merge Pull Request from: @ci-robot 
 
PR sync from: liubo <liubo254@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/ZQ7VFVIBVFWTAG7WEO5ZIGMIIEHJTPHW/ 
 
 
Link:https://gitee.com/openeuler/kernel/pulls/1374 

Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com> 
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> 
......@@ -4819,9 +4819,12 @@ int do_swapcache_reclaim(unsigned long *swapcache_watermark,
for_each_node_state(nid, N_MEMORY) {
cond_resched();
nr_to_reclaim[nid_num] = (swapcache_to_reclaim / (swapcache_total_reclaimable / nr[nid_num]));
nr_to_reclaim[nid_num] = (swapcache_total_reclaimable == 0) ? 0 :
((swapcache_to_reclaim * nr[nid_num]) /
swapcache_total_reclaimable);
reclaim_page_count += reclaim_swapcache_pages_from_list(nid,
&swapcache_list[nid_num], nr_to_reclaim[nid_num], false);
&swapcache_list[nid_num],
nr_to_reclaim[nid_num], false);
nid_num++;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册