lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1457681032-178195-1-git-send-email-albert.lubing@hisilicon.com>
Date:	Fri, 11 Mar 2016 15:23:52 +0800
From:	Lu Bing <albert.lubing@...ilicon.com>
To:	<gregkh@...uxfoundation.org>, <arve@...roid.com>,
	<riandrews@...roid.com>, <devel@...verdev.osuosl.org>,
	<linux-kernel@...r.kernel.org>, <kirill.shutemov@...ux.intel.com>
CC:	<albert.lubing@...ilicon.com>, <suzhuangluan@...ilicon.com>,
	<yudongbin@...ilicon.com>, <xuyiping@...ilicon.com>,
	<chenxiang9@...wei.com>, <oliver.fu@...ilicon.com>,
	<liuzixing@...wei.com>, <shimingxing@...ilicon.com>,
	<alan.wei@...ilicon.com>, <saberlily.xia@...ilicon.com>,
	<puck.chen@...ilicon.com>, <dan.zhao@...ilicon.com>,
	<linuxarm@...wei.com>
Subject: [PATCH] android: lmk: add swap pte pmd in tasksize

From: l00215322 <albert.lubing@...ilicon.com>

Many android devices have zram,so we should add "MM_SWAPENTS" in tasksize.
Refer oom_kill.c,we add pte&pmd also.

Reviewed-by: Chen Feng <puck.chen@...ilicon.com>
Reviewed-by: Fu Jun <oliver.fu@...ilicon.com>
Reviewed-by: Xu YiPing <xuyiping@...ilicon.com>
Reviewed-by: Yu DongBin <yudongbin@...ilicon.com>
Signed-off-by: Lu Bing <albert.lubing@...ilicon.com>
---
 drivers/staging/android/lowmemorykiller.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index 8b5a4a8..0817d3b 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -139,7 +139,9 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
 			task_unlock(p);
 			continue;
 		}
-		tasksize = get_mm_rss(p->mm);
+		tasksize = get_mm_rss(p->mm) +
+			get_mm_counter(p->mm, MM_SWAPENTS) +
+			atomic_long_read(&p->mm->nr_ptes) + mm_nr_pmds(p->mm);
 		task_unlock(p);
 		if (tasksize <= 0)
 			continue;
-- 
1.8.3.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ