Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-26 Thread Jerome Marchand
On 10/21/2015 04:39 PM, Vlastimil Babka wrote: > On 10/05/2015 05:01 AM, Hugh Dickins wrote: >> On Fri, 2 Oct 2015, Vlastimil Babka wrote: >> As you acknowledge in the commit message, if a file of 100 pages >> were copied to tmpfs, and 100 tasks map its full extent, but they >> all mess around

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-26 Thread Jerome Marchand
On 10/21/2015 04:39 PM, Vlastimil Babka wrote: > On 10/05/2015 05:01 AM, Hugh Dickins wrote: >> On Fri, 2 Oct 2015, Vlastimil Babka wrote: >> As you acknowledge in the commit message, if a file of 100 pages >> were copied to tmpfs, and 100 tasks map its full extent, but they >> all mess around

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-21 Thread Hugh Dickins
On Wed, 21 Oct 2015, Vlastimil Babka wrote: > On 10/05/2015 05:01 AM, Hugh Dickins wrote: > > On Fri, 2 Oct 2015, Vlastimil Babka wrote: > > > > > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > > > mappings, even if the mapped portion does contain pages that were

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-21 Thread Vlastimil Babka
On 10/05/2015 05:01 AM, Hugh Dickins wrote: On Fri, 2 Oct 2015, Vlastimil Babka wrote: Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed mappings, even if the mapped portion does contain pages that were swapped out. This is because unlike private anonymous mappings,

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-21 Thread Vlastimil Babka
On 10/05/2015 05:01 AM, Hugh Dickins wrote: On Fri, 2 Oct 2015, Vlastimil Babka wrote: Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed mappings, even if the mapped portion does contain pages that were swapped out. This is because unlike private anonymous mappings,

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-21 Thread Hugh Dickins
On Wed, 21 Oct 2015, Vlastimil Babka wrote: > On 10/05/2015 05:01 AM, Hugh Dickins wrote: > > On Fri, 2 Oct 2015, Vlastimil Babka wrote: > > > > > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > > > mappings, even if the mapped portion does contain pages that were

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-06 Thread Vlastimil Babka
On 10/03/2015 12:37 AM, Andrew Morton wrote: On Fri, 2 Oct 2015 15:35:49 +0200 Vlastimil Babka wrote: --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -60,6 +60,12 @@ extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, extern void

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-06 Thread Vlastimil Babka
On 10/03/2015 12:37 AM, Andrew Morton wrote: On Fri, 2 Oct 2015 15:35:49 +0200 Vlastimil Babka wrote: --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -60,6 +60,12 @@ extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, extern

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-05 Thread Peter Zijlstra
On Fri, Oct 02, 2015 at 03:35:49PM +0200, Vlastimil Babka wrote: > +static unsigned long smaps_shmem_swap(struct vm_area_struct *vma) > +{ > + struct inode *inode; > + unsigned long swapped; > + pgoff_t start, end; > + > + if (!vma->vm_file) > + return 0; > + > +

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-05 Thread Peter Zijlstra
On Fri, Oct 02, 2015 at 03:35:49PM +0200, Vlastimil Babka wrote: > +static unsigned long smaps_shmem_swap(struct vm_area_struct *vma) > +{ > + struct inode *inode; > + unsigned long swapped; > + pgoff_t start, end; > + > + if (!vma->vm_file) > + return 0; > + > +

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-04 Thread Hugh Dickins
On Fri, 2 Oct 2015, Vlastimil Babka wrote: > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > mappings, even if the mapped portion does contain pages that were swapped out. > This is because unlike private anonymous mappings, shmem does not change pte > to swap entry,

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-04 Thread Hugh Dickins
On Fri, 2 Oct 2015, Vlastimil Babka wrote: > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > mappings, even if the mapped portion does contain pages that were swapped out. > This is because unlike private anonymous mappings, shmem does not change pte > to swap entry,

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-02 Thread Andrew Morton
On Fri, 2 Oct 2015 15:35:49 +0200 Vlastimil Babka wrote: > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > mappings, even if the mapped portion does contain pages that were swapped out. > This is because unlike private anonymous mappings, shmem does not change pte >

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-02 Thread Michal Hocko
On Fri 02-10-15 15:35:49, Vlastimil Babka wrote: > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > mappings, even if the mapped portion does contain pages that were swapped out. > This is because unlike private anonymous mappings, shmem does not change pte > to swap

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-02 Thread Jerome Marchand
On 10/02/2015 03:35 PM, Vlastimil Babka wrote: > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > mappings, even if the mapped portion does contain pages that were swapped out. > This is because unlike private anonymous mappings, shmem does not change pte > to swap

[PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-02 Thread Vlastimil Babka
Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed mappings, even if the mapped portion does contain pages that were swapped out. This is because unlike private anonymous mappings, shmem does not change pte to swap entry, but pte_none when swapping the page out. In the smaps

[PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-02 Thread Vlastimil Babka
Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed mappings, even if the mapped portion does contain pages that were swapped out. This is because unlike private anonymous mappings, shmem does not change pte to swap entry, but pte_none when swapping the page out. In the smaps

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-02 Thread Jerome Marchand
On 10/02/2015 03:35 PM, Vlastimil Babka wrote: > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > mappings, even if the mapped portion does contain pages that were swapped out. > This is because unlike private anonymous mappings, shmem does not change pte > to swap

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-02 Thread Michal Hocko
On Fri 02-10-15 15:35:49, Vlastimil Babka wrote: > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > mappings, even if the mapped portion does contain pages that were swapped out. > This is because unlike private anonymous mappings, shmem does not change pte > to swap

Re: [PATCH v4 2/4] mm, proc: account for shmem swap in /proc/pid/smaps

2015-10-02 Thread Andrew Morton
On Fri, 2 Oct 2015 15:35:49 +0200 Vlastimil Babka wrote: > Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed > mappings, even if the mapped portion does contain pages that were swapped out. > This is because unlike private anonymous mappings, shmem does