From bc32a1ec0fa5d19c6d2672bcf4a01de5e1be3afb Mon Sep 17 00:00:00 2001 From: kenneth Date: Thu, 11 Nov 2021 19:44:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dlos=5Fvm=5Fscan.c?= =?UTF-8?q?=E4=B8=AD=E5=86=85=E9=83=A8=E5=87=BD=E6=95=B0OsInactiveListIsLo?= =?UTF-8?q?w=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 函数OsInactiveListIsLow()和InactiveListIsLow()代码重复,删除冗余代码。 close #I4HKFF Signed-off-by: kenneth --- kernel/base/vm/los_vm_scan.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/base/vm/los_vm_scan.c b/kernel/base/vm/los_vm_scan.c index c4c9841b..231ed18e 100644 --- a/kernel/base/vm/los_vm_scan.c +++ b/kernel/base/vm/los_vm_scan.c @@ -285,11 +285,6 @@ int OsShrinkInactiveList(LosVmPhysSeg *physSeg, int nScan, LOS_DL_LIST *list) return nrReclaimed; } -bool InactiveListIsLow(LosVmPhysSeg *physSeg) -{ - return (physSeg->lruSize[VM_LRU_ACTIVE_FILE] > physSeg->lruSize[VM_LRU_INACTIVE_FILE]) ? TRUE : FALSE; -} - #ifdef LOSCFG_FS_VFS int OsTryShrinkMemory(size_t nPage) { @@ -319,7 +314,7 @@ int OsTryShrinkMemory(size_t nPage) continue; } - if (InactiveListIsLow(physSeg)) { + if (OsInactiveListIsLow(physSeg)) { OsShrinkActiveList(physSeg, (nPage < VM_FILEMAP_MIN_SCAN) ? VM_FILEMAP_MIN_SCAN : nPage); } -- GitLab