Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753973AbcCNB0v (ORCPT ); Sun, 13 Mar 2016 21:26:51 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:57222 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752239AbcCNB0o (ORCPT ); Sun, 13 Mar 2016 21:26:44 -0400 Subject: Re: [PATCH] android: lmk: add swap pte pmd in tasksize To: Greg KH References: <1457681032-178195-1-git-send-email-albert.lubing@hisilicon.com> <8DA5D99D-7542-4ABB-9DB4-076B255A5F75@gmail.com> <56E28A69.9040409@hisilicon.com> <20160311171213.GA1458@kroah.com> CC: yalin wang , Lu Bing , , , , , , , , , , , , , , , , From: Chen Feng Message-ID: <56E61328.8000101@hisilicon.com> Date: Mon, 14 Mar 2016 09:26:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160311171213.GA1458@kroah.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.193.64] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.56E6133A.005A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0d9915a93d89bb05dc57ba22bfdb0afc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1859 Lines: 54 Hi greg, On 2016/3/12 1:12, Greg KH wrote: > On Fri, Mar 11, 2016 at 05:05:45PM +0800, Chen Feng wrote: >> >> >> On 2016/3/11 15:30, yalin wang wrote: >>> >>>> On Mar 11, 2016, at 15:23, Lu Bing wrote: >>>> >>>> From: l00215322 >>>> >>>> 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 >>>> Reviewed-by: Fu Jun >>>> Reviewed-by: Xu YiPing >>>> Reviewed-by: Yu DongBin >>>> Signed-off-by: Lu Bing >>>> --- >>>> 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); >>> why not introduce a mm_nr_ptes() help function here ? >>> more clear to see . >>> >> Since the code is in staging, we can add another patch to do this. > > I do not understand this, please explain. > I mean that we can submit another patch to add mm_nr_ptes() in mm-module and replace the code used nr_ptes with this interface(mm_nr_ptes()). This patch is just change the score of task-size in low memory killer. > thanks, > > greg k-h > > . >