All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Xishi Qiu <qiuxishi@huawei.com>, Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: why the count nr_file_pages is not equal to nr_inactive_file + nr_active_file ?
Date: Fri, 13 May 2016 15:00:58 +0800	[thread overview]
Message-ID: <dce01643-7aa9-e779-e4ac-b74439f5074d@intel.com> (raw)
In-Reply-To: <573550D8.9030507@huawei.com>

On 05/13/2016 11:58 AM, Xishi Qiu wrote:
> 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?

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 194472
nr_alloc_batch 58
nr_inactive_anon 483386
nr_active_anon 298161
nr_inactive_file 452791
nr_active_file 1942376
nr_unevictable 84
nr_mlock 84
nr_anon_pages 445332
nr_mapped 93553
nr_file_pages 2731481
[aaron@aaronlu ~]$ fallocate -l 400M /dev/shm/test
[aaron@aaronlu ~]$ head -11 /proc/vmstat 
nr_free_pages 94808
nr_alloc_batch 838
nr_inactive_anon 582385
nr_active_anon 298371
nr_inactive_file 452795
nr_active_file 1942380
nr_unevictable 84
nr_mlock 84
nr_anon_pages 445543
nr_mapped 93658
nr_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

> 
> Thanks,
> Xishi Qiu
> 
> root@hi3650:/ # cat /proc/vmstat 
> nr_free_pages 54192
> nr_inactive_anon 39830
> nr_active_anon 28794
> nr_inactive_file 432444
> nr_active_file 20659
> nr_unevictable 2363
> nr_mlock 0
> nr_anon_pages 65249
> nr_mapped 19742
> nr_file_pages 462723
> nr_dirty 20
> nr_writeback 0
> ...
> 
> 
> nr_inactive_file 432444
> nr_active_file 20659
> total is 453103
> 
> nr_file_pages 462723
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Aaron Lu <aaron.lu@intel.com>
To: Xishi Qiu <qiuxishi@huawei.com>, Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: why the count nr_file_pages is not equal to nr_inactive_file + nr_active_file ?
Date: Fri, 13 May 2016 15:00:58 +0800	[thread overview]
Message-ID: <dce01643-7aa9-e779-e4ac-b74439f5074d@intel.com> (raw)
In-Reply-To: <573550D8.9030507@huawei.com>

On 05/13/2016 11:58 AM, Xishi Qiu wrote:
> 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?

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 194472
nr_alloc_batch 58
nr_inactive_anon 483386
nr_active_anon 298161
nr_inactive_file 452791
nr_active_file 1942376
nr_unevictable 84
nr_mlock 84
nr_anon_pages 445332
nr_mapped 93553
nr_file_pages 2731481
[aaron@aaronlu ~]$ fallocate -l 400M /dev/shm/test
[aaron@aaronlu ~]$ head -11 /proc/vmstat 
nr_free_pages 94808
nr_alloc_batch 838
nr_inactive_anon 582385
nr_active_anon 298371
nr_inactive_file 452795
nr_active_file 1942380
nr_unevictable 84
nr_mlock 84
nr_anon_pages 445543
nr_mapped 93658
nr_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

> 
> Thanks,
> Xishi Qiu
> 
> root@hi3650:/ # cat /proc/vmstat 
> nr_free_pages 54192
> nr_inactive_anon 39830
> nr_active_anon 28794
> nr_inactive_file 432444
> nr_active_file 20659
> nr_unevictable 2363
> nr_mlock 0
> nr_anon_pages 65249
> nr_mapped 19742
> nr_file_pages 462723
> nr_dirty 20
> nr_writeback 0
> ...
> 
> 
> nr_inactive_file 432444
> nr_active_file 20659
> total is 453103
> 
> nr_file_pages 462723
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
> 

  reply	other threads:[~2016-05-13  7:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13  3:58 why the count nr_file_pages is not equal to nr_inactive_file + nr_active_file ? Xishi Qiu
2016-05-13  3:58 ` Xishi Qiu
2016-05-13  7:00 ` Aaron Lu [this message]
2016-05-13  7:00   ` Aaron Lu
2016-05-13  7:31   ` Xishi Qiu
2016-05-13  7:31     ` Xishi Qiu
2016-05-16  9:57     ` Michal Hocko
2016-05-16  9:57       ` Michal Hocko
2016-05-16 10:01       ` Xishi Qiu
2016-05-16 10:01         ` Xishi Qiu
2016-05-16 11:16         ` Michal Hocko
2016-05-16 11:16           ` Michal Hocko
2016-05-16  9:31 ` Michal Hocko
2016-05-16  9:31   ` Michal Hocko
2016-05-16  9:58   ` Xishi Qiu
2016-05-16  9:58     ` Xishi Qiu

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=dce01643-7aa9-e779-e4ac-b74439f5074d@intel.com \
    --to=aaron.lu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=qiuxishi@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.