On 2022-02-10 12:28 a.m., Christoph Hellwig wrote: > Key off on the existence of ->page_free to prepare for adding support for > more pgmap types that are device managed and thus need the free callback. > > Signed-off-by: Christoph Hellwig <h...@lst.de> Great! This makes my patch simpler. Reviewed-by: Logan Gunthorpe <log...@deltatee.com> > --- > mm/memremap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/memremap.c b/mm/memremap.c > index fef5734d5e4933..e00ffcdba7b632 100644 > --- a/mm/memremap.c > +++ b/mm/memremap.c > @@ -452,7 +452,7 @@ EXPORT_SYMBOL_GPL(get_dev_pagemap); > > void free_zone_device_page(struct page *page) > { > - if (WARN_ON_ONCE(!is_device_private_page(page))) > + if (WARN_ON_ONCE(!page->pgmap->ops || !page->pgmap->ops->page_free)) > return; > > __ClearPageWaiters(page); > @@ -460,7 +460,7 @@ void free_zone_device_page(struct page *page) > mem_cgroup_uncharge(page_folio(page)); > > /* > - * When a device_private page is freed, the page->mapping field > + * When a device managed page is freed, the page->mapping field > * may still contain a (stale) mapping value. For example, the > * lower bits of page->mapping may still identify the page as an > * anonymous page. Ultimately, this entire field is just stale >
- [Nouveau] [PATCH 01/27] mm: remove a pointless CONFIG_ZO... Christoph Hellwig
- [Nouveau] [PATCH 02/27] mm: remove the __KERNEL__ guard ... Christoph Hellwig
- [Nouveau] [PATCH 03/27] mm: remove pointless includes fr... Christoph Hellwig
- [Nouveau] [PATCH 05/27] mm: simplify freeing of devmap m... Christoph Hellwig
- [Nouveau] [PATCH 04/27] mm: move free_devmap_managed_pag... Christoph Hellwig
- [Nouveau] [PATCH 06/27] mm: don't include <linux/memr... Christoph Hellwig
- [Nouveau] [PATCH 07/27] mm: remove the extra ZONE_DEVICE... Christoph Hellwig
- [Nouveau] [PATCH 08/27] fsdax: depend on ZONE_DEVICE || ... Christoph Hellwig
- [Nouveau] [PATCH 09/27] mm: generalize the pgmap based p... Christoph Hellwig
- Re: [Nouveau] [PATCH 09/27] mm: generalize the pgma... Logan Gunthorpe
- [Nouveau] [PATCH 10/27] mm: refactor check_and_migrate_m... Christoph Hellwig
- [Nouveau] [PATCH 11/27] mm: refactor the ZONE_DEVICE han... Christoph Hellwig
- [Nouveau] [PATCH 12/27] mm: refactor the ZONE_DEVICE han... Christoph Hellwig
- [Nouveau] [PATCH 14/27] mm: build migrate_vma_* for all ... Christoph Hellwig
- [Nouveau] [PATCH 15/27] mm: add zone device coherent typ... Christoph Hellwig
- [Nouveau] [PATCH 13/27] mm: move the migrate_vma_* devic... Christoph Hellwig
- Re: [Nouveau] [PATCH 13/27] mm: move the migrate_vm... Christoph Hellwig
- [Nouveau] [PATCH 16/27] mm: add device coherent vma sele... Christoph Hellwig
- [Nouveau] [PATCH 17/27] mm/gup: fail get_user_pages for ... Christoph Hellwig
- [Nouveau] [PATCH 18/27] drm/amdkfd: add SPM support for ... Christoph Hellwig