Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-18 Thread Minchan Kim
On Fri, May 16, 2014 at 10:38:00PM +0300, Kirill A. Shutemov wrote: > On Fri, May 16, 2014 at 03:34:27PM +0900, Minchan Kim wrote: > > > > +static inline unsigned long lazyfree_pmd_range(struct mmu_gather *tlb, > > > > + struct vm_area_struct *vma, pud_t *pud, > > > >

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-18 Thread Minchan Kim
On Fri, May 16, 2014 at 10:38:00PM +0300, Kirill A. Shutemov wrote: On Fri, May 16, 2014 at 03:34:27PM +0900, Minchan Kim wrote: +static inline unsigned long lazyfree_pmd_range(struct mmu_gather *tlb, + struct vm_area_struct *vma, pud_t *pud, +

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-16 Thread Kirill A. Shutemov
On Fri, May 16, 2014 at 03:34:27PM +0900, Minchan Kim wrote: > > > +static inline unsigned long lazyfree_pmd_range(struct mmu_gather *tlb, > > > + struct vm_area_struct *vma, pud_t *pud, > > > + unsigned long addr, unsigned long end) > > > +{ > > > +

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-16 Thread Minchan Kim
Hey, Hannes, Please take a rest during holidays but really thanksful to you! On Thu, May 15, 2014 at 11:46:58AM -0400, Johannes Weiner wrote: > Hi Minchan, > > On Mon, May 12, 2014 at 10:26:28AM +0900, Minchan Kim wrote: > > Linux doesn't have an ability to free pages lazy while other OS > >

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-16 Thread Minchan Kim
Hey, Hannes, Please take a rest during holidays but really thanksful to you! On Thu, May 15, 2014 at 11:46:58AM -0400, Johannes Weiner wrote: Hi Minchan, On Mon, May 12, 2014 at 10:26:28AM +0900, Minchan Kim wrote: Linux doesn't have an ability to free pages lazy while other OS already

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-16 Thread Kirill A. Shutemov
On Fri, May 16, 2014 at 03:34:27PM +0900, Minchan Kim wrote: +static inline unsigned long lazyfree_pmd_range(struct mmu_gather *tlb, + struct vm_area_struct *vma, pud_t *pud, + unsigned long addr, unsigned long end) +{ + pmd_t *pmd;

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-15 Thread Rik van Riel
On 05/15/2014 11:46 AM, Johannes Weiner wrote: diff --git a/include/linux/mm.h b/include/linux/mm.h index bf9811e1321a..c69594c141a9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1082,6 +1082,8 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-15 Thread Johannes Weiner
Hi Minchan, On Mon, May 12, 2014 at 10:26:28AM +0900, Minchan Kim wrote: > Linux doesn't have an ability to free pages lazy while other OS > already have been supported that named by madvise(MADV_FREE). > > The gain is clear that kernel can discard freed pages rather than > swapping out or OOM

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-15 Thread Johannes Weiner
Hi Minchan, On Mon, May 12, 2014 at 10:26:28AM +0900, Minchan Kim wrote: Linux doesn't have an ability to free pages lazy while other OS already have been supported that named by madvise(MADV_FREE). The gain is clear that kernel can discard freed pages rather than swapping out or OOM if

Re: [PATCH v6] mm: support madvise(MADV_FREE)

2014-05-15 Thread Rik van Riel
On 05/15/2014 11:46 AM, Johannes Weiner wrote: diff --git a/include/linux/mm.h b/include/linux/mm.h index bf9811e1321a..c69594c141a9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1082,6 +1082,8 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,

[PATCH v6] mm: support madvise(MADV_FREE)

2014-05-11 Thread Minchan Kim
Linux doesn't have an ability to free pages lazy while other OS already have been supported that named by madvise(MADV_FREE). The gain is clear that kernel can discard freed pages rather than swapping out or OOM if memory pressure happens. Without memory pressure, freed pages would be reused by

[PATCH v6] mm: support madvise(MADV_FREE)

2014-05-11 Thread Minchan Kim
Linux doesn't have an ability to free pages lazy while other OS already have been supported that named by madvise(MADV_FREE). The gain is clear that kernel can discard freed pages rather than swapping out or OOM if memory pressure happens. Without memory pressure, freed pages would be reused by