Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Andrea Arcangeli
On Tue, May 24, 2016 at 12:49:42AM +0300, Kirill A. Shutemov wrote: > That's what we do now and that's not enough. > > We would need to serialize against pmd_lock() during normal page-fault > path (and other pte manipulation), which we don't do now if pmd points to > page table. Yes, mmap_sem for

Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Kirill A. Shutemov
On Mon, May 23, 2016 at 04:13:03PM -0400, Rik van Riel wrote: > On Mon, 2016-05-23 at 23:02 +0300, Kirill A. Shutemov wrote: > > On Mon, May 23, 2016 at 03:26:47PM -0400, Rik van Riel wrote: > > > > > > On Mon, 2016-05-23 at 22:01 +0300, Kirill A. Shutemov wrote: > > > > > > > > On Mon, May 23, 2

Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Rik van Riel
On Mon, 2016-05-23 at 23:02 +0300, Kirill A. Shutemov wrote: > On Mon, May 23, 2016 at 03:26:47PM -0400, Rik van Riel wrote: > > > > On Mon, 2016-05-23 at 22:01 +0300, Kirill A. Shutemov wrote: > > > > > > On Mon, May 23, 2016 at 02:49:09PM -0400, Rik van Riel wrote: > > > > > > > > > > > > On

Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Kirill A. Shutemov
On Mon, May 23, 2016 at 03:26:47PM -0400, Rik van Riel wrote: > On Mon, 2016-05-23 at 22:01 +0300, Kirill A. Shutemov wrote: > > On Mon, May 23, 2016 at 02:49:09PM -0400, Rik van Riel wrote: > > > > > > On Mon, 2016-05-23 at 20:42 +0200, Michal Hocko wrote: > > > > > > > > On Mon 23-05-16 20:14:1

Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Rik van Riel
On Mon, 2016-05-23 at 22:01 +0300, Kirill A. Shutemov wrote: > On Mon, May 23, 2016 at 02:49:09PM -0400, Rik van Riel wrote: > > > > On Mon, 2016-05-23 at 20:42 +0200, Michal Hocko wrote: > > > > > > On Mon 23-05-16 20:14:11, Ebru Akagunduz wrote: > > > > > > > > > > > > Currently khugepaged ma

Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Kirill A. Shutemov
On Mon, May 23, 2016 at 02:49:09PM -0400, Rik van Riel wrote: > On Mon, 2016-05-23 at 20:42 +0200, Michal Hocko wrote: > > On Mon 23-05-16 20:14:11, Ebru Akagunduz wrote: > > > > > > Currently khugepaged makes swapin readahead under > > > down_write. This patch supplies to make swapin > > > readah

Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Rik van Riel
On Mon, 2016-05-23 at 20:42 +0200, Michal Hocko wrote: > On Mon 23-05-16 20:14:11, Ebru Akagunduz wrote: > > > > Currently khugepaged makes swapin readahead under > > down_write. This patch supplies to make swapin > > readahead under down_read instead of down_write. > You are still keeping down_wr

Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Michal Hocko
On Mon 23-05-16 20:14:11, Ebru Akagunduz wrote: > Currently khugepaged makes swapin readahead under > down_write. This patch supplies to make swapin > readahead under down_read instead of down_write. You are still keeping down_write. Can we do without it altogether? Blocking mmap_sem of a remote p

Re: [PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Kirill A. Shutemov
On Mon, May 23, 2016 at 08:14:11PM +0300, Ebru Akagunduz wrote: > Currently khugepaged makes swapin readahead under > down_write. This patch supplies to make swapin > readahead under down_read instead of down_write. > > The patch was tested with a test program that allocates > 800MB of memory, wri

[PATCH 3/3] mm, thp: make swapin readahead under down_read of mmap_sem

2016-05-23 Thread Ebru Akagunduz
Currently khugepaged makes swapin readahead under down_write. This patch supplies to make swapin readahead under down_read instead of down_write. The patch was tested with a test program that allocates 800MB of memory, writes to it, and then sleeps. The system was forced to swap out all. Afterward