Re: [PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-03-27 Thread Vlastimil Babka
On 02/26/2015 03:59 PM, Jerome Marchand wrote: > On 02/26/2015 02:51 PM, Vlastimil Babka wrote: >> >> +/* Optimized variant when page is already known not to be PageAnon */ >> +static inline int mm_counter_file(struct page *page) > > Just a nitpick, but I don't like that name as it keeps the

Re: [PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-03-27 Thread Vlastimil Babka
On 02/26/2015 03:59 PM, Jerome Marchand wrote: On 02/26/2015 02:51 PM, Vlastimil Babka wrote: +/* Optimized variant when page is already known not to be PageAnon */ +static inline int mm_counter_file(struct page *page) Just a nitpick, but I don't like that name as it keeps the confusion

Re: [PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-02-27 Thread Michael Kerrisk
[CC += linux-api@] On Thu, Feb 26, 2015 at 2:51 PM, Vlastimil Babka wrote: > From: Jerome Marchand > > Currently looking at /proc//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

Re: [PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-02-27 Thread Michael Kerrisk
[CC += linux-api@] On Thu, Feb 26, 2015 at 2:51 PM, Vlastimil Babka vba...@suse.cz wrote: From: Jerome Marchand jmarc...@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

Re: [PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-02-26 Thread Hillf Danton
> @@ -501,6 +502,7 @@ static void smaps_pte_entry(pte_t *pte, unsigned long > addr, > pte_none(*pte) && vma->vm_file) { > struct address_space *mapping = > file_inode(vma->vm_file)->i_mapping; > + pgoff_t pgoff

Re: [PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-02-26 Thread Jerome Marchand
On 02/26/2015 02:51 PM, Vlastimil Babka wrote: > From: Jerome Marchand > > Currently looking at /proc//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

[PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-02-26 Thread Vlastimil Babka
From: Jerome Marchand Currently looking at /proc//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

Re: [PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-02-26 Thread Jerome Marchand
On 02/26/2015 02:51 PM, Vlastimil Babka wrote: From: Jerome Marchand jmarc...@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

[PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-02-26 Thread Vlastimil Babka
From: Jerome Marchand jmarc...@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

Re: [PATCH 3/4] mm, shmem: Add shmem resident memory accounting

2015-02-26 Thread Hillf Danton
@@ -501,6 +502,7 @@ static void smaps_pte_entry(pte_t *pte, unsigned long addr, pte_none(*pte) vma-vm_file) { struct address_space *mapping = file_inode(vma-vm_file)-i_mapping; + pgoff_t pgoff =