From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425154AbcBRGv6 (ORCPT ); Thu, 18 Feb 2016 01:51:58 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:64691 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161199AbcBRGv5 (ORCPT ); Thu, 18 Feb 2016 01:51:57 -0500 Message-ID: <56C569EC.7070107@huawei.com> Date: Thu, 18 Feb 2016 14:51:24 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: David Rientjes CC: Greg Kroah-Hartman , , , , zhong jiang , LKML , Linux MM Subject: Re: [PATCH] mm: add MM_SWAPENTS and page table when calculate tasksize in lowmem_scan() References: <56C2EDC1.2090509@huawei.com> <20160216173849.GA10487@kroah.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.56C569FF.0110,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 989503803b1d8793e7cecf5181a5dbc4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/2/17 8:35, David Rientjes wrote: > On Tue, 16 Feb 2016, Greg Kroah-Hartman wrote: > >> On Tue, Feb 16, 2016 at 05:37:05PM +0800, Xishi Qiu wrote: >>> Currently tasksize in lowmem_scan() only calculate rss, and not include swap. >>> But usually smart phones enable zram, so swap space actually use ram. >> >> Yes, but does that matter for this type of calculation? I need an ack >> from the android team before I could ever take such a core change to >> this code... >> > > The calculation proposed in this patch is the same as the generic oom > killer, it's an estimate of the amount of memory that will be freed if it > is killed and can exit. This is better than simply get_mm_rss(). > > However, I think we seriously need to re-consider the implementation of > the lowmem killer entirely. It currently abuses the use of TIF_MEMDIE, > which should ideally only be set for one thread on the system since it > allows unbounded access to global memory reserves. > Hi David, Does somebody do the work of re-implementation of the lowmem killer entirely now? Could you give me some details? e.g. when and how? Here are another two questions. 1) lmk has several lowmem thresholds, it's "lowmem_minfree[]", and the value is static definition, so is it reasonable for different memory size(e.g. 2G/3G/4G...) of smart phones? 2) There are many adjustable arguments in /proc/sys/vm/, and the default value maybe not benefit for smart phones, so any suggestions? Thanks, Xishi Qiu > It also abuses the user-visible /proc/self/oom_score_adj tunable: this > tunable is used by the generic oom killer to bias or discount a proportion > of memory from a process's usage. This is the only supported semantic of > the tunable. The lowmem killer uses it as a strict prioritization, so any > process with oom_score_adj higher than another process is preferred for > kill, REGARDLESS of memory usage. This leads to priority inversion, the > user is unable to always define the same process to be killed by the > generic oom killer and the lowmem killer. This is what happens when a > tunable with a very clear and defined purpose is used for other reasons. > > I'd seriously consider not accepting any additional hacks on top of this > code until the implementation is rewritten. > > . >