Commit 905e7deb authored by liubo's avatar liubo
Browse files

etmem: fix the div 0 problem in swapcache reclaim process

euleros inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7JI6K


CVE: NA

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

In the swapcache recycling process, the number of pages
to be reclaimed on each node is obtained as follows:

nr_to_reclaim[nid_num] = (swapcache_to_reclaim / (swapcache_total_reclaimable / nr[nid_num]));

However, nr[nid_num] is obtained by traversing the number
of swapcache pages on each node.
If there are multiple nodes in the environment and
no swap process occurs on a node, no swapcache page exists.
The value of nr[nid_num] may be 0.

Therefore, division by zero errors may occur.

Signed-off-by: default avatarliubo <liubo254@huawei.com>
parent 32613ac5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment