Re: [PATCH v2 3/4] mm, shmem: Add shmem resident memory accounting
From: Vlastimil Babka <hidden>
Date: 2015-05-14 11:17:41
Also in:
linux-mm, linux-s390, lkml
On 03/27/2015 06:09 PM, Konstantin Khlebnikov wrote:
On 27.03.2015 19:40, Vlastimil Babka wrote:quoted
From: Jerome Marchand <redacted> 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 <redacted> Signed-off-by: Vlastimil Babka <redacted> ---quoted
--- 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 */ +#endifI prefer to keep that counter unconditionally: kernel has MM_SWAPENTS even without CONFIG_SWAP.
Hmm, so just for consistency? I don't see much reason to make life harder for tiny systems, especially when it's not too much effort.
quoted
NR_MM_COUNTERS };-- 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>