[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161121124218.GF2392@redhat.com>
Date: Mon, 21 Nov 2016 07:42:19 -0500
From: Jerome Glisse <jglisse@...hat.com>
To: Anshuman Khandual <khandual@...ux.vnet.ibm.com>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, John Hubbard <jhubbard@...dia.com>,
Dan Williams <dan.j.williams@...el.com>,
Ross Zwisler <ross.zwisler@...ux.intel.com>
Subject: Re: [HMM v13 06/18] mm/ZONE_DEVICE/unaddressable: add special swap
for unaddressable
On Mon, Nov 21, 2016 at 04:28:04PM +0530, Anshuman Khandual wrote:
> On 11/18/2016 11:48 PM, Jérôme Glisse wrote:
> > To allow use of device un-addressable memory inside a process add a
> > special swap type. Also add a new callback to handle page fault on
> > such entry.
>
> IIUC this swap type is required only for the mirror cases and its
> not a requirement for migration. If it's required for mirroring
> purpose where we intercept each page fault, the commit message
> here should clearly elaborate on that more.
It is only require for un-addressable memory. The mirroring has nothing to do
with it. I will clarify commit message.
[...]
> > diff --git a/include/linux/memremap.h b/include/linux/memremap.h
> > index b6f03e9..d584c74 100644
> > --- a/include/linux/memremap.h
> > +++ b/include/linux/memremap.h
> > @@ -47,6 +47,11 @@ static inline struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
> > */
> > struct dev_pagemap {
> > void (*free_devpage)(struct page *page, void *data);
> > + int (*fault)(struct vm_area_struct *vma,
> > + unsigned long addr,
> > + struct page *page,
> > + unsigned flags,
> > + pmd_t *pmdp);
>
> We are extending the dev_pagemap once again to accommodate device driver
> specific fault routines for these pages. Wondering if this extension and
> the new swap type should be in the same patch.
It make sense to have it in one single patch as i also change page fault code
path to deal with the new special swap entry and those make use of this new
callback.
> > +int device_entry_fault(struct vm_area_struct *vma,
> > + unsigned long addr,
> > + swp_entry_t entry,
> > + unsigned flags,
> > + pmd_t *pmdp)
> > +{
> > + struct page *page = device_entry_to_page(entry);
> > +
>
> A BUG_ON() if page->pgmap->fault has not been populated by the driver.
>
Ok
Cheers,
Jérôme
Powered by blists - more mailing lists