add page fault pages to list head to avoid be swapped out soon

Change-Id: I6efd6ac17432771baee600d6af8191917104ac27
Signed-off-by: huangzq2 <huangzq2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2793884
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
huangzq2 2023-11-13 15:46:43 +08:00 • committed by PDO SCM Team
commit 7735d45448

View file

@ -1956,8 +1956,9 @@ static void __move_to_zram(struct zram *zram, u32 index, unsigned long handle,
swap_maps_destroy(zram, index);
zram_set_handle(zram, index, handle);
zram_clear_flag(zram, index, ZRAM_WB);
// Moto: add to head to avoid be swapped out soon.
if (mcg)
swap_sorted_list_add_tail(zram, index, mcg);
swap_sorted_list_add(zram, index, mcg);
zram_set_flag(zram, index, ZRAM_FROM_HYBRIDSWAP);
atomic64_add(size, &zram->stats.compr_data_size);
atomic64_inc(&zram->stats.pages_stored);