linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: <zhiyuan_zhu@htc.com>
To: gregkh@linuxfoundation.org
Cc: vinmenon@codeaurora.org, linux-mm@kvack.org,
	skhiani@codeaurora.org, torvalds@linux-foundation.org,
	Jet_Li@htc.com
Subject: RE: Low memory killer problem
Date: Mon, 15 May 2017 08:22:38 +0000	[thread overview]
Message-ID: <AF7C0ADF1FEABA4DABABB97411952A2EDD0A4F84@CN-MBX03.HTC.COM.TW> (raw)
In-Reply-To: <20170515080535.GA22076@kroah.com>

Dear Greg, 

Very sorry my mail history is lost.

I found a part of ION memory will be return to system in android platform,
But these memorys  can’t accounted in low-memory-killer strategy.
…
And I also found ION memory comes from,  kmalloc/vmalloc/alloc pages/reserved memory.
I understand reserved memory shouldn't accounted to free memory.
But the memory which alloced by kmalloc/vmalloc/alloc pages, can be reclaimed.

But the low-memory killer can't accounted this part,
Many thanks.

Code location, 
   ---> drivers/staging/android/lowmemorykiller.c   -> lowmem_scan

Code review,
415         other_free = global_page_state(NR_FREE_PAGES);
416 
417         if (global_page_state(NR_SHMEM) + global_page_state(NR_MLOCK) + total_swapcache_pages() <
418                 global_page_state(NR_FILE_PAGES) + zcache_pages())
419                 other_file = global_page_state(NR_FILE_PAGES) + zcache_pages() -
420                                                 global_page_state(NR_SHMEM) -
422                                                 total_swapcache_pages();

So, other_free means:  MemFree,
other_file means: Buffers + Cached - ShMEM - SwapCache.
And part of  ( IonInUse - IonTotal ) should be reclaimed but not accounted.
Thanks.

Meminfo example
$ adb shell cat /proc/meminfo
MemTotal:        3805312 kB
MemFree:         1446220 kB
MemAvailable:    2388384 kB
Buffers:           16796 kB
Cached:          1190868 kB
…
IonTotal:         224252 kB
IonInUse:         199108 kB


Thanks
BR
Zhiyuan zhu

-----Original Message-----
From: Greg KH [mailto:gregkh@linuxfoundation.org] 
Sent: Monday, May 15, 2017 4:06 PM
To: Zhiyuan Zhu(朱志遠)
Cc: vinmenon@codeaurora.org; linux-mm@kvack.org; skhiani@codeaurora.org; torvalds@linux-foundation.org
Subject: Re: Low memory killer problem

On Mon, May 15, 2017 at 07:25:20AM +0000, zhiyuan_zhu@htc.com wrote:
> Loop MM maintainers,
> 
>  
> 
> Dear All,
> 
>  
> 
> Who can talk about this problem? Thanks.

What problem?

> Maybe this is lowmemory killer’s bug ?

This code is now removed from the kernel, so I doubt there could be a bug in it :)

> ION memory is complex now, we need to have a breakdown for them, I think.

What do you mean by this?

thanks,

greg k-h


  reply	other threads:[~2017-05-15  8:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AF7C0ADF1FEABA4DABABB97411952A2EDD0A004D@CN-MBX05.HTC.COM.TW>
2017-05-15  3:58 ` zhiyuan_zhu
2017-05-15  7:25 ` zhiyuan_zhu
2017-05-15  8:05   ` Greg KH
2017-05-15  8:22     ` zhiyuan_zhu [this message]
2017-05-15  9:00       ` Greg KH
2017-05-16  3:41         ` zhiyuan_zhu
2017-05-16  5:56           ` Greg KH
2017-05-16 22:37           ` Laura Abbott
2017-05-17  2:47             ` zhiyuan_zhu

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=AF7C0ADF1FEABA4DABABB97411952A2EDD0A4F84@CN-MBX03.HTC.COM.TW \
    --to=zhiyuan_zhu@htc.com \
    --cc=Jet_Li@htc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-mm@kvack.org \
    --cc=skhiani@codeaurora.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vinmenon@codeaurora.org \
    /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