[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140723135221.GA6754@linux.intel.com>
Date: Wed, 23 Jul 2014 09:52:22 -0400
From: Matthew Wilcox <willy@...ux.intel.com>
To: "Kirill A. Shutemov" <kirill@...temov.name>
Cc: Matthew Wilcox <matthew.r.wilcox@...el.com>,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 05/22] Add vm_replace_mixed()
On Wed, Jul 23, 2014 at 02:45:40PM +0300, Kirill A. Shutemov wrote:
> On Tue, Jul 22, 2014 at 03:47:53PM -0400, Matthew Wilcox wrote:
> > From: Matthew Wilcox <willy@...ux.intel.com>
> >
> > vm_insert_mixed() will fail if there is already a valid PTE at that
> > location. The DAX code would rather replace the previous value with
> > the new PTE.
> > @@ -1492,8 +1492,12 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
> > if (!pte)
> > goto out;
> > retval = -EBUSY;
> > - if (!pte_none(*pte))
> > - goto out_unlock;
> > + if (!pte_none(*pte)) {
> > + if (!replace)
> > + goto out_unlock;
> > + VM_BUG_ON(!mutex_is_locked(&vma->vm_file->f_mapping->i_mmap_mutex));
> > + zap_page_range_single(vma, addr, PAGE_SIZE, NULL);
>
> zap_page_range_single() takes ptl by itself in zap_pte_range(). It's not
> going to work.
I have a test program that exercises this path ... it seems to work!
Following the code, I don't understand why it does. Maybe it's not
exercising this path after all? I've attached the program (so that I
have an "oh, duh" moment about 5 seconds after sending the email).
> And zap_page_range*() is pretty heavy weapon to shoot down one pte, which
> we already have pointer to. Why?
I'd love to use a lighter-weight weapon! What would you recommend using,
zap_pte_range()?
View attachment "dax-mmap-write-hole.c" of type "text/x-csrc" (767 bytes)
Powered by blists - more mailing lists