From: <zhiyuan_zhu@htc.com>
To: mhocko@suse.cz
Cc: hannes@cmpxchg.org, Future_Zhou@htc.com, Rachel_Zhang@htc.com,
bsingharora@gmail.com, kamezawa.hiroyu@jp.fujitsu.com,
cgroups@vger.kernel.org, linux-mm@kvack.org, greg@kroah.com,
Sai_Shen@htc.com
Subject: 答复: 答复: low memory killer
Date: Thu, 20 Nov 2014 12:05:00 +0000 [thread overview]
Message-ID: <AF7C0ADF1FEABA4DABABB97411952A2EC91FE0@CN-MBX02.HTC.COM.TW> (raw)
In-Reply-To: <20141120101855.GB24575@dhcp22.suse.cz>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 3599 bytes --]
Hi Greg/Michal
Very sorry I have a mistake in previous mail. (It should be nr_file_pages not nr_free_pages)
I rearrange this problem.
// *********** log begin **********
6 161030.084144 2014-11-07 21:44:53.304 lowmemorykiller: Killing 'om.htc.launcher' (4486), adj 294,
6 161030.084144 2014-11-07 21:44:53.304 to free 47856kB on behalf of 'kworker/u8:14' (20594) because
6 161030.084144 2014-11-07 21:44:53.304 cache 72460kB is below limit 73728kB for oom_score_adj 235
// **** /proc/meminfo 's result
4 161030.084797 2014-11-07 21:44:53.304 Cached: 142448 kB
// *********** log end **********
After I checked the android's low memory strategy: kernel/drivers/staging/android/lowmemorykiller.c
// ****** code begin *********
other_file = global_page_state(NR_FILE_PAGES) -
global_page_state(NR_SHMEM) -
total_swapcache_pages();
lowmem_print(1, "Killing '%s' (%d), adj %hd,\n" \
" to free %ldkB on behalf of '%s' (%d) because\n" \
" cache %ldkB is below limit %ldkB for oom_score_adj %hd\n" \
" Free memory is %ldkB above reserved\n",
selected->comm, selected->pid,
selected_oom_score_adj,
selected_tasksize * (long)(PAGE_SIZE / 1024),
current->comm, current->pid,
other_file * (long)(PAGE_SIZE / 1024),
minfree * (long)(PAGE_SIZE / 1024),
min_score_adj,
other_free * (long)(PAGE_SIZE / 1024));
// ******* code end ************
So android's strategy's free memory is = other_file = (nr file pages - nr shmem - total swapcache pages) * 4K = [cache 72460kB]
But the system's free memory is: Cached: 142448 kB // from /proc/meminfo
And system's free memory is: Cached + MemFree + Buffers is largely than the memory which anroid lowmemorykiller calculated memory [cache 72460K]
At this time point, system will kill some important processes, but system have enough memory.
This is android's lowmemorykiller defect? or Linux kernel memory's defect?
So I have some questions:
I have a question: what's the nr file pages mean? What different between nr_file_pages from Cached (from /proc/meminfo)?
And nr shmem, swapcache pages are small, so I think this is the key problem why android's stragegy calculated free memory is largely less than /proc/meminfo Cached's value.
Thanks
Zhiyuan zhu
-----ÓʼþÔ¼þ-----
·¢¼þÈË: Michal Hocko [mailto:mhocko@suse.cz]
·¢ËÍʱ¼ä: 2014Äê11ÔÂ20ÈÕ 18:19
ÊÕ¼þÈË: Zhiyuan Zhu(ÖìÖ¾ßh)
³ËÍ: hannes@cmpxchg.org; Future Zhou(ÖÜδí); Rachel Zhang(¬); bsingharora@gmail.com; kamezawa.hiroyu@jp.fujitsu.com; cgroups@vger.kernel.org; linux-mm@kvack.org; greg@kroah.com
Ö÷Ìâ: Re: ´ð¸´: low memory killer
On Thu 20-11-14 10:09:25, zhiyuan_zhu@htc.com wrote:
> Hi Michal
> Thanks for your kindly support.
> I got a device, and dump the /proc/meminfo and /proc/vmstat files,
> they are the Linux standard proc files.
> I found that: Cached = 339880 KB, but nr_free_pages=14675*4 = 58700KB
> and nr_shmem = 508*4=2032KB
>
> nr_shmem is just a little memory, and nr free pages + nr_shmem is
> largely less than Cached. So why nr_free_pages is largely less than
> Cached? Thank you.
nr_free_pages refers to pages which are not allocated. Cached referes to a used memory which is easily reclaimable so it can be reused should there be a need and free memory drops down. So this is a normal situation. How is this related to the lowmemory killer question posted previously?
[...]
--
Michal Hocko
SUSE Labs
[-- Attachment #2: Type: text/html, Size: 6775 bytes --]
next prev parent reply other threads:[~2014-11-20 12:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 9:26 zhiyuan_zhu
2014-11-20 9:58 ` Michal Hocko
2014-11-20 10:09 ` 答复: " zhiyuan_zhu
2014-11-20 10:18 ` Michal Hocko
2014-11-20 12:05 ` zhiyuan_zhu [this message]
2014-11-20 14:19 ` 答复: " Weijie Yang
2014-11-24 16:17 ` Michal Hocko
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=AF7C0ADF1FEABA4DABABB97411952A2EC91FE0@CN-MBX02.HTC.COM.TW \
--to=zhiyuan_zhu@htc.com \
--cc=Future_Zhou@htc.com \
--cc=Rachel_Zhang@htc.com \
--cc=Sai_Shen@htc.com \
--cc=bsingharora@gmail.com \
--cc=cgroups@vger.kernel.org \
--cc=greg@kroah.com \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
/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