linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] android: lmk: add swap pte pmd in tasksize
@ 2016-03-11  7:23 Lu Bing
  2016-03-11  7:30 ` yalin wang
  2016-03-31  1:25 ` Greg KH
  0 siblings, 2 replies; 7+ messages in thread
From: Lu Bing @ 2016-03-11  7:23 UTC (permalink / raw)
  To: gregkh, arve, riandrews, devel, linux-kernel, kirill.shutemov
  Cc: albert.lubing, suzhuangluan, yudongbin, xuyiping, chenxiang9,
	oliver.fu, liuzixing, shimingxing, alan.wei, saberlily.xia,
	puck.chen, dan.zhao, linuxarm

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);
 		task_unlock(p);
 		if (tasksize <= 0)
 			continue;
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] android: lmk: add swap pte pmd in tasksize
  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-31  1:25 ` Greg KH
  1 sibling, 1 reply; 7+ messages in thread
From: yalin wang @ 2016-03-11  7:30 UTC (permalink / raw)
  To: Lu Bing
  Cc: gregkh, arve, riandrews, devel, linux-kernel, kirill.shutemov,
	suzhuangluan, yudongbin, xuyiping, chenxiang9, oliver.fu,
	liuzixing, shimingxing, alan.wei, saberlily.xia, puck.chen,
	dan.zhao, linuxarm


> 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 .

> 		task_unlock(p);
> 		if (tasksize <= 0)
> 			continue;
> -- 
> 1.8.3.2
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] android: lmk: add swap pte pmd in tasksize
  2016-03-11  7:30 ` yalin wang
@ 2016-03-11  9:05   ` Chen Feng
  2016-03-11 17:12     ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Chen Feng @ 2016-03-11  9:05 UTC (permalink / raw)
  To: yalin wang, Lu Bing
  Cc: gregkh, arve, riandrews, devel, linux-kernel, kirill.shutemov,
	suzhuangluan, yudongbin, xuyiping, chenxiang9, oliver.fu,
	liuzixing, shimingxing, alan.wei, saberlily.xia, dan.zhao,
	linuxarm



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.


>> 		task_unlock(p);
>> 		if (tasksize <= 0)
>> 			continue;
>> -- 
>> 1.8.3.2
>>
> 
> 
> .
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] android: lmk: add swap pte pmd in tasksize
  2016-03-11  9:05   ` Chen Feng
@ 2016-03-11 17:12     ` Greg KH
  2016-03-14  1:26       ` Chen Feng
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2016-03-11 17:12 UTC (permalink / raw)
  To: Chen Feng
  Cc: yalin wang, Lu Bing, devel, dan.zhao, chenxiang9, xuyiping,
	suzhuangluan, linuxarm, riandrews, alan.wei, linux-kernel, arve,
	saberlily.xia, shimingxing, oliver.fu, liuzixing, yudongbin,
	kirill.shutemov

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.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] android: lmk: add swap pte pmd in tasksize
  2016-03-11 17:12     ` Greg KH
@ 2016-03-14  1:26       ` Chen Feng
  2016-03-31  1:26         ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Chen Feng @ 2016-03-14  1:26 UTC (permalink / raw)
  To: Greg KH
  Cc: yalin wang, Lu Bing, devel, dan.zhao, chenxiang9, xuyiping,
	suzhuangluan, linuxarm, riandrews, alan.wei, linux-kernel, arve,
	saberlily.xia, shimingxing, oliver.fu, liuzixing, yudongbin,
	kirill.shutemov

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
> 
> .
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] android: lmk: add swap pte pmd in tasksize
  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-31  1:25 ` Greg KH
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2016-03-31  1:25 UTC (permalink / raw)
  To: Lu Bing
  Cc: arve, riandrews, devel, linux-kernel, kirill.shutemov,
	suzhuangluan, yudongbin, xuyiping, chenxiang9, oliver.fu,
	liuzixing, shimingxing, alan.wei, saberlily.xia, puck.chen,
	dan.zhao, linuxarm

On Fri, Mar 11, 2016 at 03:23:52PM +0800, Lu Bing wrote:
> From: l00215322 <albert.lubing@hisilicon.com>

I need a name here, not a number, for an author.

Please resend in the proper format, so it can be applied.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] android: lmk: add swap pte pmd in tasksize
  2016-03-14  1:26       ` Chen Feng
@ 2016-03-31  1:26         ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2016-03-31  1:26 UTC (permalink / raw)
  To: Chen Feng
  Cc: yalin wang, Lu Bing, devel, dan.zhao, chenxiang9, xuyiping,
	suzhuangluan, linuxarm, riandrews, alan.wei, linux-kernel, arve,
	saberlily.xia, shimingxing, oliver.fu, liuzixing, yudongbin,
	kirill.shutemov

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 <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.

Ok, I'll drop this from my queue.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-31  1:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2016-03-31  1:26         ` Greg KH
2016-03-31  1:25 ` Greg KH

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).