Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-15 Thread yalin wang
> On Nov 16, 2015, at 10:13, Minchan Kim wrote: > > On Fri, Nov 13, 2015 at 11:46:07AM -0800, Andy Lutomirski wrote: >> On Fri, Nov 13, 2015 at 12:13 AM, Daniel Micay wrote: >>> On 13/11/15 02:03 AM, Minchan Kim wrote: On Fri, Nov 13, 2015 at 01:45:52AM -0500, Daniel Micay wrote: >> An

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-15 Thread Minchan Kim
On Fri, Nov 13, 2015 at 11:46:07AM -0800, Andy Lutomirski wrote: > On Fri, Nov 13, 2015 at 12:13 AM, Daniel Micay wrote: > > On 13/11/15 02:03 AM, Minchan Kim wrote: > >> On Fri, Nov 13, 2015 at 01:45:52AM -0500, Daniel Micay wrote: > And now I am thinking if we use access bit, we could implm

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-13 Thread Andy Lutomirski
On Fri, Nov 13, 2015 at 12:13 AM, Daniel Micay wrote: > On 13/11/15 02:03 AM, Minchan Kim wrote: >> On Fri, Nov 13, 2015 at 01:45:52AM -0500, Daniel Micay wrote: And now I am thinking if we use access bit, we could implment MADV_FREE_UNDO easily when we need it. Maybe, that's what

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-13 Thread Daniel Micay
On 13/11/15 02:03 AM, Minchan Kim wrote: > On Fri, Nov 13, 2015 at 01:45:52AM -0500, Daniel Micay wrote: >>> And now I am thinking if we use access bit, we could implment MADV_FREE_UNDO >>> easily when we need it. Maybe, that's what you want. Right? >> >> Yes, but why the access bit instead of the

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-12 Thread Minchan Kim
On Fri, Nov 13, 2015 at 01:45:52AM -0500, Daniel Micay wrote: > > And now I am thinking if we use access bit, we could implment MADV_FREE_UNDO > > easily when we need it. Maybe, that's what you want. Right? > > Yes, but why the access bit instead of the dirty bit for that? It could > always be mad

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-12 Thread Daniel Micay
> And now I am thinking if we use access bit, we could implment MADV_FREE_UNDO > easily when we need it. Maybe, that's what you want. Right? Yes, but why the access bit instead of the dirty bit for that? It could always be made more strict (i.e. access bit) in the future, while going the other way

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-12 Thread Minchan Kim
On Fri, Nov 13, 2015 at 01:16:54AM -0500, Daniel Micay wrote: > On 13/11/15 01:15 AM, Minchan Kim wrote: > > On Thu, Nov 12, 2015 at 12:21:30AM -0500, Daniel Micay wrote: > >>> I also think that the kernel should commit to either zeroing the page > >>> or leaving it unchanged in response to MADV_FR

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-12 Thread Minchan Kim
On Thu, Nov 12, 2015 at 01:26:20PM +0200, Kirill A. Shutemov wrote: > On Thu, Nov 12, 2015 at 01:32:57PM +0900, Minchan Kim wrote: > > @@ -256,6 +260,125 @@ static long madvise_willneed(struct vm_area_struct > > *vma, > > return 0; > > } > > > > +static int madvise_free_pte_range(pmd_t *pmd

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-12 Thread Daniel Micay
On 13/11/15 01:15 AM, Minchan Kim wrote: > On Thu, Nov 12, 2015 at 12:21:30AM -0500, Daniel Micay wrote: >>> I also think that the kernel should commit to either zeroing the page >>> or leaving it unchanged in response to MADV_FREE (even if the decision >>> of which to do is made later on). I thin

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-12 Thread Minchan Kim
On Thu, Nov 12, 2015 at 12:21:30AM -0500, Daniel Micay wrote: > > I also think that the kernel should commit to either zeroing the page > > or leaving it unchanged in response to MADV_FREE (even if the decision > > of which to do is made later on). I think that your patch series does > > this, but

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-12 Thread Kirill A. Shutemov
On Thu, Nov 12, 2015 at 01:32:57PM +0900, Minchan Kim wrote: > @@ -256,6 +260,125 @@ static long madvise_willneed(struct vm_area_struct *vma, > return 0; > } > > +static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr, > + unsigned long end, struct mm_

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-11 Thread Daniel Micay
> I also think that the kernel should commit to either zeroing the page > or leaving it unchanged in response to MADV_FREE (even if the decision > of which to do is made later on). I think that your patch series does > this, but only after a few of the patches are applied (the swap entry > freeing

Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-11 Thread Andy Lutomirski
On Wed, Nov 11, 2015 at 8:32 PM, 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 memory pressure hap

[PATCH v3 01/17] mm: support madvise(MADV_FREE)

2015-11-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 u