Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-17 Thread Johannes Weiner
On Fri, Feb 17, 2017 at 10:43:41AM -0800, Shaohua Li wrote: > On Fri, Feb 17, 2017 at 11:01:54AM -0500, Johannes Weiner wrote: > > On Thu, Feb 16, 2017 at 04:27:18PM -0800, Shaohua Li wrote: > > > On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > > > > On Tue, Feb 14, 2017 at 11:36

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-17 Thread Shaohua Li
On Fri, Feb 17, 2017 at 11:01:54AM -0500, Johannes Weiner wrote: > On Thu, Feb 16, 2017 at 04:27:18PM -0800, Shaohua Li wrote: > > On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > > > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > > > > @@ -911,7 +911,7 @@ static vo

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-17 Thread Johannes Weiner
On Fri, Feb 17, 2017 at 02:41:08PM +0900, Minchan Kim wrote: > Hi Johannes, > > On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > > > @@ -911,7 +911,7 @@ static void page_check_dirty_writeback(struct page > > > *page

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-17 Thread Johannes Weiner
Hi Minchan, On Fri, Feb 17, 2017 at 02:45:55PM +0900, Minchan Kim wrote: > On Thu, Feb 16, 2017 at 04:27:18PM -0800, Shaohua Li wrote: > > On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > > > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > > > > @@ -1419,11 +1419,18

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-17 Thread Johannes Weiner
On Thu, Feb 16, 2017 at 04:27:18PM -0800, Shaohua Li wrote: > On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > > > @@ -911,7 +911,7 @@ static void page_check_dirty_writeback(struct page > > > *page, > > >* Anonym

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-17 Thread Minchan Kim
On Fri, Feb 17, 2017 at 02:41:08PM +0900, Minchan Kim wrote: > Hi Johannes, > > On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > > > @@ -1419,11 +1419,18 @@ static int try_to_unmap_one(struct page *page, > > > struc

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-16 Thread Minchan Kim
Hi Shaohua, On Thu, Feb 16, 2017 at 04:27:18PM -0800, Shaohua Li wrote: > On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > > > @@ -1419,11 +1419,18 @@ static int try_to_unmap_one(struct page *page, > > > struct vm_a

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-16 Thread Minchan Kim
Hi Johannes, On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > > @@ -1419,11 +1419,18 @@ static int try_to_unmap_one(struct page *page, > > struct vm_area_struct *vma, > > VM_BUG_ON_PAGE(!PageSwapCa

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-16 Thread Shaohua Li
On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote: > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > > @@ -1419,11 +1419,18 @@ static int try_to_unmap_one(struct page *page, > > struct vm_area_struct *vma, > > VM_BUG_ON_PAGE(!PageSwapCache(page) &&

Re: [PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-16 Thread Johannes Weiner
On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote: > @@ -1419,11 +1419,18 @@ static int try_to_unmap_one(struct page *page, struct > vm_area_struct *vma, > VM_BUG_ON_PAGE(!PageSwapCache(page) && > PageSwapBacked(page), > page); > > -

[PATCH V3 3/7] mm: reclaim MADV_FREE pages

2017-02-14 Thread Shaohua Li
When memory pressure is high, we free MADV_FREE pages. If the pages are not dirty in pte, the pages could be freed immediately. Otherwise we can't reclaim them. We put the pages back to anonumous LRU list (by setting SwapBacked flag) and the pages will be reclaimed in normal swapout way. We use no