lkml.org 
[lkml]   [2015]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/4] mm, shmem: Add shmem resident memory accounting
On 27.03.2015 19:40, Vlastimil Babka wrote:
> From: Jerome Marchand <jmarchan@redhat.com>
>
> Currently looking at /proc/<pid>/status or statm, there is no way to
> distinguish shmem pages from pages mapped to a regular file (shmem
> pages are mapped to /dev/zero), even though their implication in
> actual memory use is quite different.
> This patch adds MM_SHMEMPAGES counter to mm_rss_stat to account for
> shmem pages instead of MM_FILEPAGES.
>
> Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> ---


> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -327,9 +327,12 @@ struct core_state {
> };
>
> enum {
> - MM_FILEPAGES,
> - MM_ANONPAGES,
> - MM_SWAPENTS,
> + MM_FILEPAGES, /* Resident file mapping pages */
> + MM_ANONPAGES, /* Resident anonymous pages */
> + MM_SWAPENTS, /* Anonymous swap entries */
> +#ifdef CONFIG_SHMEM
> + MM_SHMEMPAGES, /* Resident shared memory pages */
> +#endif

I prefer to keep that counter unconditionally:
kernel has MM_SWAPENTS even without CONFIG_SWAP.

> NR_MM_COUNTERS
> };
>


\
 
 \ /
  Last update: 2015-03-27 18:21    [W:0.084 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site