Re: [PATCH] mm: page_mkclean vs MADV_DONTNEED race

2019-03-22 Thread Aneesh Kumar K.V
Andrew Morton writes: > On Thu, 21 Mar 2019 09:36:10 +0530 "Aneesh Kumar K.V" > wrote: > >> MADV_DONTNEED is handled with mmap_sem taken in read mode. >> We call page_mkclean without holding mmap_sem. >> >> MADV_DONTNEED implies that pages in the region are unmapped and subsequent >> access

Re: [PATCH] mm: page_mkclean vs MADV_DONTNEED race

2019-03-21 Thread Andrew Morton
On Thu, 21 Mar 2019 09:36:10 +0530 "Aneesh Kumar K.V" wrote: > MADV_DONTNEED is handled with mmap_sem taken in read mode. > We call page_mkclean without holding mmap_sem. > > MADV_DONTNEED implies that pages in the region are unmapped and subsequent > access to the pages in that range is

[PATCH] mm: page_mkclean vs MADV_DONTNEED race

2019-03-20 Thread Aneesh Kumar K.V
MADV_DONTNEED is handled with mmap_sem taken in read mode. We call page_mkclean without holding mmap_sem. MADV_DONTNEED implies that pages in the region are unmapped and subsequent access to the pages in that range is handled as a new page fault. This implies that if we don't have parallel access