Modify swap size unit(bytes->mbytes) 16/269116/1
authorUnsung Lee <unsung.lee@samsung.com>
Mon, 10 Jan 2022 03:38:31 +0000 (12:38 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Mon, 10 Jan 2022 03:39:00 +0000 (12:39 +0900)
Change-Id: I428240e773ddd001de4e8f1d318039a0da55116a
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-limiter/memory/vmpressure-lowmem-handler.c

index 7182937..fd1002b 100644 (file)
@@ -809,7 +809,7 @@ static unsigned int is_memory_recovered(unsigned int *avail, unsigned int thres)
 
        *avail = available;
 
-       _I("[LMK] should_be_freed=%uMB[== threshold - available + margin]", should_be_freed);
+       _I("[LMK] should_be_freed=%uMB[== threshold(%u) - available(%u) + margin(%u)]", should_be_freed, thres, available, THRESHOLD_MARGIN);
        return should_be_freed;
 }
 
@@ -2166,7 +2166,7 @@ void lowmem_trigger_swap_reclaim(enum lmk_type type, int swap_size)
        victims = num_max_victims  > MAX_PROACTIVE_HIGH_VICTIMS
                                 ? MAX_PROACTIVE_HIGH_VICTIMS : num_max_victims;
 
-       size = get_root_memcg_info()->threshold_leave + swap_size;
+       size = get_root_memcg_info()->threshold_leave + BYTE_TO_MBYTE(swap_size);
        _I("reclaim from swap module, type : %d, size : %d, victims: %d", type, size, victims);
        lowmem_trigger_reclaim(0, victims, type, size);
 }