why the count nr_file_pages is not equal to nr_inactive_file + nr_active_file ?
I find the count nr_file_pages is not equal to nr_inactive_file + nr_active_file. There are 8 cpus, 2 zones in my system.
I think may be the pagevec trigger the problem, but PAGEVEC_SIZE is only 14. Does anyone know the reason?
Thanks,
Xishi Qiu
root@hi3650:/ # cat /proc/vmstatnr_free_pages 54192nr_inactive_anon 39830nr_active_anon 28794nr_inactive_file 432444nr_active_file 20659nr_unevictable 2363nr_mlock 0nr_anon_pages 65249nr_mapped 19742nr_file_pages 462723nr_dirty 20nr_writeback 0
...
nr_inactive_file 432444nr_active_file 20659
total is 453103
nr_file_pages 462723
Quoted 5 lines · Xishi Qiu
I find the count
nr_file_pagesis not equal tonr_inactive_file+nr_active_file. There are 8 cpus, 2 zones in my system.I think may be the pagevec trigger the problem, but
PAGEVEC_SIZEis only 14. Does anyone know the reason?
One thing I can see is the ram backed filesystem where the page is counted as NR_FILE_PAGE but go into the anonymous LRU list instead of the file LRU list.
See function shmem_getpage_gfp.
An example:
[aaron@aaronlu ~]$ head -11 /proc/vmstat nr_free_pages 194472nr_alloc_batch 58nr_inactive_anon 483386nr_active_anon 298161nr_inactive_file 452791nr_active_file 1942376nr_unevictable 84nr_mlock 84nr_anon_pages 445332nr_mapped 93553nr_file_pages 2731481
[aaron@aaronlu ~]$ fallocate -l 400M /dev/shm/test [aaron@aaronlu ~]$ head -11 /proc/vmstat nr_free_pages 94808nr_alloc_batch 838nr_inactive_anon 582385nr_active_anon 298371nr_inactive_file 452795nr_active_file 1942380nr_unevictable 84nr_mlock 84nr_anon_pages 445543nr_mapped 93658nr_file_pages 2830488
The nr_file_pages increased with nr_inactive_anon while the nr_{in}active_file don't see much change.
Regards,
Aaron
Quoted 24 lines
Thanks,
Xishi Qiuroot@hi3650:/ # cat
/proc/vmstatnr_free_pages54192nr_inactive_anon39830nr_active_anon28794nr_inactive_file432444nr_active_file20659nr_unevictable2363nr_mlock0nr_anon_pages65249nr_mapped19742nr_file_pages462723nr_dirty20nr_writeback0
...
nr_inactive_file432444nr_active_file20659
total is 453103
Quoted 8 lines
nr_file_pages462723--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 40 lines · Aaron Lu
Quoted 5 lines · Xishi Qiu
I find the count
nr_file_pagesis not equal tonr_inactive_file+nr_active_file. There are 8 cpus, 2 zones in my system.I think may be the pagevec trigger the problem, but
PAGEVEC_SIZEis only 14. Does anyone know the reason?One thing I can see is the ram backed filesystem where the page is counted as
NR_FILE_PAGEbut go into the anonymous LRU list instead of the file LRU list.See function
shmem_getpage_gfp.An example:
[aaron@aaronlu ~]$ head -11/proc/vmstatnr_free_pages194472nr_alloc_batch58nr_inactive_anon483386nr_active_anon298161nr_inactive_file452791nr_active_file1942376nr_unevictable84nr_mlock84nr_anon_pages445332nr_mapped93553nr_file_pages2731481
[aaron@aaronlu ~]$ fallocate -l 400M/dev/shm/test[aaron@aaronlu ~]$ head -11/proc/vmstatnr_free_pages94808nr_alloc_batch838nr_inactive_anon582385nr_active_anon298371nr_inactive_file452795nr_active_file1942380nr_unevictable84nr_mlock84nr_anon_pages445543nr_mapped93658nr_file_pages2830488
Quoted 6 lines
The
nr_file_pagesincreased withnr_inactive_anonwhile the nr_{in}active_file don't see much change.Regards,
Aaron
Hi Aaron,
Thanks for your reply, but I find the count of nr_shmem is very small in my system.
root@hi3650:/ # cat /proc/vmstatnr_free_pages 54192nr_inactive_anon 39830nr_active_anon 28794nr_inactive_file 432444nr_active_file 20659nr_unevictable 2363nr_mlock 0nr_anon_pages 65249nr_mapped 19742nr_file_pages 462723nr_dirty 20nr_writeback 0nr_slab_reclaimable 259333nr_slab_unreclaimable 33463nr_page_table_pages 3456nr_kernel_stack 892nr_unstable 0nr_bounce 11nr_vmscan_write 292032nr_vmscan_immediate_reclaim 47204474nr_writeback_temp 0nr_isolated_anon 0nr_isolated_file 0nr_shmem 128nr_dirtied 69574nr_written 356299nr_anon_transparent_hugepages 0nr_free_cma 7519nr_swapcache 41972nr_dirty_threshold 6982nr_dirty_background_threshold 99297
[Sorry I haven't noticed this answer before]
Quoted 6 lines · Xishi Qiu
On 2016/5/13 15:00, Aaron Lu wrote:
Hi Aaron,
Thanks for your reply, but I find the count of
nr_shmemis very small in my system.
which kernel version is this? I remember that we used to account thp pages as NR_FILE_PAGE as well in the past.
I didn't get to look at your number more closely though.
Signature · 8 lines
Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Michal Hocko
[Sorry I haven't noticed this answer before]
Quoted 4 lines · Xishi Qiu
On 2016/5/13 15:00, Aaron Lu wrote:
Hi Aaron,
Quoted 7 lines
Quoted 2 lines
Thanks for your reply, but I find the count of
nr_shmemis very small in my system.which kernel version is this? I remember that we used to account thp pages as
NR_FILE_PAGEas well in the past.I didn't get to look at your number more closely though.
Hi Michal,
It's android kernel, v3.10
I think the thp config is off.
Thanks,
Xishi Qiu
Quoted 15 lines · Xishi Qiu
Quoted 13 lines · Michal Hocko
[Sorry I haven't noticed this answer before]
Quoted 6 lines · Xishi Qiu
On 2016/5/13 15:00, Aaron Lu wrote:
Hi Aaron,
Thanks for your reply, but I find the count of
nr_shmemis very small in my system.which kernel version is this? I remember that we used to account thp pages as
NR_FILE_PAGEas well in the past.
Quoted 6 lines
Quoted 1 line
I didn't get to look at your number more closely though.
Hi Michal,
It's android kernel, v3.10
I think the thp config is off.
Ble. Not enough sleep. I didn't mean thp but hugetlb pages. Sorry about the confusion. If even that is not the case then there is either an accounting bug or some fs doesn't put pages in the pagecache directly to the LRUs or thos pages are on unevictable list.
Signature · 8 lines
Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 2 lines · Xishi Qiu
I find the count
nr_file_pagesis not equal tonr_inactive_file+nr_active_file. There are 8 cpus, 2 zones in my system.
Because they count shmem pages as well and those are living on the anon lru list (see shmem_add_to_page_cache).
Signature · 8 lines
Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 6 lines · Michal Hocko
Quoted 2 lines · Xishi Qiu
I find the count
nr_file_pagesis not equal tonr_inactive_file+nr_active_file. There are 8 cpus, 2 zones in my system.Because they count shmem pages as well and those are living on the anon lru list (see
shmem_add_to_page_cache).
Hi Michal,
But the shmem seems very small.
nr_inactive_file 432444nr_active_file 20659nr_unevictable 2363nr_shmem 128
nr_file_pages 462723
There is still 7129 pages difference.
root@hi3650:/ # cat /proc/vmstatnr_free_pages 54192nr_inactive_anon 39830nr_active_anon 28794nr_inactive_file 432444nr_active_file 20659nr_unevictable 2363nr_mlock 0nr_anon_pages 65249nr_mapped 19742nr_file_pages 462723nr_dirty 20nr_writeback 0nr_slab_reclaimable 259333nr_slab_unreclaimable 33463nr_page_table_pages 3456nr_kernel_stack 892nr_unstable 0nr_bounce 11nr_vmscan_write 292032nr_vmscan_immediate_reclaim 47204474nr_writeback_temp 0nr_isolated_anon 0nr_isolated_file 0nr_shmem 128nr_dirtied 69574nr_written 356299nr_anon_transparent_hugepages 0nr_free_cma 7519nr_swapcache 41972nr_dirty_threshold 6982nr_dirty_background_threshold 99297