linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Feng <puck.chen@hisilicon.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: yalin wang <yalin.wang2010@gmail.com>,
	Lu Bing <albert.lubing@hisilicon.com>,
	<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
Date: Mon, 14 Mar 2016 09:26:00 +0800	[thread overview]
Message-ID: <56E61328.8000101@hisilicon.com> (raw)
In-Reply-To: <20160311171213.GA1458@kroah.com>

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 <albert.lubing@hisilicon.com> wrote:
>>>>
>>>> From: l00215322 <albert.lubing@hisilicon.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@hisilicon.com>
>>>> Reviewed-by: Fu Jun <oliver.fu@hisilicon.com>
>>>> Reviewed-by: Xu YiPing <xuyiping@hisilicon.com>
>>>> Reviewed-by: Yu DongBin <yudongbin@hisilicon.com>
>>>> Signed-off-by: Lu Bing <albert.lubing@hisilicon.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);
>>> 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
> 
> .
> 

  reply	other threads:[~2016-03-14  1:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11  7:23 [PATCH] android: lmk: add swap pte pmd in tasksize Lu Bing
2016-03-11  7:30 ` yalin wang
2016-03-11  9:05   ` Chen Feng
2016-03-11 17:12     ` Greg KH
2016-03-14  1:26       ` Chen Feng [this message]
2016-03-31  1:26         ` Greg KH
2016-03-31  1:25 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E61328.8000101@hisilicon.com \
    --to=puck.chen@hisilicon.com \
    --cc=alan.wei@hisilicon.com \
    --cc=albert.lubing@hisilicon.com \
    --cc=arve@android.com \
    --cc=chenxiang9@huawei.com \
    --cc=dan.zhao@hisilicon.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuzixing@huawei.com \
    --cc=oliver.fu@hisilicon.com \
    --cc=riandrews@android.com \
    --cc=saberlily.xia@hisilicon.com \
    --cc=shimingxing@hisilicon.com \
    --cc=suzhuangluan@hisilicon.com \
    --cc=xuyiping@hisilicon.com \
    --cc=yalin.wang2010@gmail.com \
    --cc=yudongbin@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).