Re: [PATCH 2/2] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages
From: Dan Williams
Date: Fri Nov 15 2019 - 11:42:11 EST
On Thu, Nov 14, 2019 at 4:11 PM John Hubbard <jhubbard@xxxxxxxxxx> wrote:
>
> An upcoming patch changes and complicates the refcounting and
> especially the "put page" aspects of it. In order to keep
> everything clean, refactor the devmap page release routines:
>
> * Rename put_devmap_managed_page() to page_is_devmap_managed(),
> and limit the functionality to "read only": return a bool,
> with no side effects.
>
> * Add a new routine, put_devmap_managed_page(), to handle checking
> what kind of page it is, and what kind of refcount handling it
> requires.
>
> * Rename __put_devmap_managed_page() to free_devmap_managed_page(),
> and limit the functionality to unconditionally freeing a devmap
> page.
>
> This is originally based on a separate patch by Ira Weiny, which
> applied to an early version of the put_user_page() experiments.
> Since then, JÃrÃme Glisse suggested the refactoring described above.
>
> Cc: Jan Kara <jack@xxxxxxx>
> Cc: JÃrÃme Glisse <jglisse@xxxxxxxxxx>
> Cc: Christoph Hellwig <hch@xxxxxx>
> Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> Suggested-by: JÃrÃme Glisse <jglisse@xxxxxxxxxx>
> Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
> Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
> ---
> include/linux/mm.h | 27 ++++++++++++++++++++++++---
> mm/memremap.c | 16 ++--------------
> 2 files changed, 26 insertions(+), 17 deletions(-)
Looks good,
Reviewed-by: Dan Williams <dan.j.williams@xxxxxxxxx>