Unverified Commit cd0c6a73 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

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

parents 0aa0ca11 905e7deb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4913,8 +4913,10 @@ 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);