Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-12 Thread Minchan Kim
Hi Shaohua, On Fri, Feb 10, 2017 at 09:30:09AM -0800, Shaohua Li wrote: < snip > > > > +static inline bool page_is_lazyfree(struct page *page) > > > +{ > > > + return PageAnon(page) && !PageSwapBacked(page); > > > +} > > > + > > > > trivial: > > > > How about using PageLazyFree for

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-12 Thread Minchan Kim
Hi Shaohua, On Fri, Feb 10, 2017 at 09:30:09AM -0800, Shaohua Li wrote: < snip > > > > +static inline bool page_is_lazyfree(struct page *page) > > > +{ > > > + return PageAnon(page) && !PageSwapBacked(page); > > > +} > > > + > > > > trivial: > > > > How about using PageLazyFree for

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-10 Thread Shaohua Li
On Fri, Feb 10, 2017 at 02:02:36PM +0100, Michal Hocko wrote: > On Fri 03-02-17 15:33:18, Shaohua Li wrote: > > Userspace indicates MADV_FREE pages could be freed without pageout, so > > it pretty much likes used once file pages. For such pages, we'd like to > > reclaim them once there is memory

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-10 Thread Shaohua Li
On Fri, Feb 10, 2017 at 02:02:36PM +0100, Michal Hocko wrote: > On Fri 03-02-17 15:33:18, Shaohua Li wrote: > > Userspace indicates MADV_FREE pages could be freed without pageout, so > > it pretty much likes used once file pages. For such pages, we'd like to > > reclaim them once there is memory

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-10 Thread Shaohua Li
On Fri, Feb 10, 2017 at 03:50:22PM +0900, Minchan Kim wrote: > Hi Shaohua, Thanks for your time! > On Fri, Feb 03, 2017 at 03:33:18PM -0800, Shaohua Li wrote: > > Userspace indicates MADV_FREE pages could be freed without pageout, so > > it pretty much likes used once file pages. For such

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-10 Thread Shaohua Li
On Fri, Feb 10, 2017 at 03:50:22PM +0900, Minchan Kim wrote: > Hi Shaohua, Thanks for your time! > On Fri, Feb 03, 2017 at 03:33:18PM -0800, Shaohua Li wrote: > > Userspace indicates MADV_FREE pages could be freed without pageout, so > > it pretty much likes used once file pages. For such

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-10 Thread Michal Hocko
On Fri 03-02-17 15:33:18, Shaohua Li wrote: > Userspace indicates MADV_FREE pages could be freed without pageout, so > it pretty much likes used once file pages. For such pages, we'd like to > reclaim them once there is memory pressure. Also it might be unfair > reclaiming MADV_FREE pages always

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-10 Thread Michal Hocko
On Fri 03-02-17 15:33:18, Shaohua Li wrote: > Userspace indicates MADV_FREE pages could be freed without pageout, so > it pretty much likes used once file pages. For such pages, we'd like to > reclaim them once there is memory pressure. Also it might be unfair > reclaiming MADV_FREE pages always

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-09 Thread Minchan Kim
Hi Shaohua, On Fri, Feb 03, 2017 at 03:33:18PM -0800, Shaohua Li wrote: > Userspace indicates MADV_FREE pages could be freed without pageout, so > it pretty much likes used once file pages. For such pages, we'd like to > reclaim them once there is memory pressure. Also it might be unfair >

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-09 Thread Minchan Kim
Hi Shaohua, On Fri, Feb 03, 2017 at 03:33:18PM -0800, Shaohua Li wrote: > Userspace indicates MADV_FREE pages could be freed without pageout, so > it pretty much likes used once file pages. For such pages, we'd like to > reclaim them once there is memory pressure. Also it might be unfair >

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-08 Thread Hillf Danton
On February 04, 2017 2:38 PM Hillf Danton wrote: > > On February 04, 2017 7:33 AM Shaohua Li wrote: > > @@ -1404,6 +1401,8 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, > > struct vm_area_struct *vma, > > set_pmd_at(mm, addr, pmd, orig_pmd); > >

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-08 Thread Hillf Danton
On February 04, 2017 2:38 PM Hillf Danton wrote: > > On February 04, 2017 7:33 AM Shaohua Li wrote: > > @@ -1404,6 +1401,8 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, > > struct vm_area_struct *vma, > > set_pmd_at(mm, addr, pmd, orig_pmd); > >

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-03 Thread Hillf Danton
On February 04, 2017 7:33 AM Shaohua Li wrote: > @@ -1404,6 +1401,8 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, > struct vm_area_struct *vma, > set_pmd_at(mm, addr, pmd, orig_pmd); > tlb_remove_pmd_tlb_entry(tlb, pmd, addr); > } > + > +

Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-03 Thread Hillf Danton
On February 04, 2017 7:33 AM Shaohua Li wrote: > @@ -1404,6 +1401,8 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, > struct vm_area_struct *vma, > set_pmd_at(mm, addr, pmd, orig_pmd); > tlb_remove_pmd_tlb_entry(tlb, pmd, addr); > } > + > +

[PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-03 Thread Shaohua Li
Userspace indicates MADV_FREE pages could be freed without pageout, so it pretty much likes used once file pages. For such pages, we'd like to reclaim them once there is memory pressure. Also it might be unfair reclaiming MADV_FREE pages always before used once file pages and we definitively want

[PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

2017-02-03 Thread Shaohua Li
Userspace indicates MADV_FREE pages could be freed without pageout, so it pretty much likes used once file pages. For such pages, we'd like to reclaim them once there is memory pressure. Also it might be unfair reclaiming MADV_FREE pages always before used once file pages and we definitively want