Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755039AbcCaB1g (ORCPT ); Wed, 30 Mar 2016 21:27:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53534 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbcCaB1e (ORCPT ); Wed, 30 Mar 2016 21:27:34 -0400 Date: Wed, 30 Mar 2016 18:26:00 -0700 From: Greg KH To: Chen Feng Cc: yalin wang , Lu Bing , devel@driverdev.osuosl.org, dan.zhao@hisilicon.com, chenxiang9@huawei.com, xuyiping@hisilicon.com, suzhuangluan@hisilicon.com, linuxarm@huawei.com, riandrews@android.com, alan.wei@hisilicon.com, linux-kernel@vger.kernel.org, arve@android.com, saberlily.xia@hisilicon.com, shimingxing@hisilicon.com, oliver.fu@hisilicon.com, liuzixing@huawei.com, yudongbin@hisilicon.com, kirill.shutemov@linux.intel.com Subject: Re: [PATCH] android: lmk: add swap pte pmd in tasksize Message-ID: <20160331012600.GC28422@kroah.com> 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> <56E61328.8000101@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E61328.8000101@hisilicon.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2012 Lines: 50 On Mon, Mar 14, 2016 at 09:26:00AM +0800, Chen Feng wrote: > 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. Ok, I'll drop this from my queue.