]> Git Repo - linux.git/commit
mm: remove the extra ZONE_DEVICE struct page refcount
authorChristoph Hellwig <[email protected]>
Wed, 16 Feb 2022 04:31:36 +0000 (15:31 +1100)
committerMatthew Wilcox (Oracle) <[email protected]>
Thu, 3 Mar 2022 17:47:33 +0000 (12:47 -0500)
commit27674ef6c73f0c9096a9827dc5d6ba9fc7808422
tree1f57be13e778f35d1ca21902eb4c355d5476b44c
parentdc90f0846df4870b6cc8528c31e5c60f18fb68be
mm: remove the extra ZONE_DEVICE struct page refcount

ZONE_DEVICE struct pages have an extra reference count that complicates
the code for put_page() and several places in the kernel that need to
check the reference count to see that a page is not being used (gup,
compaction, migration, etc.). Clean up the code so the reference count
doesn't need to be treated specially for ZONE_DEVICE pages.

Note that this excludes the special idle page wakeup for fsdax pages,
which still happens at refcount 1.  This is a separate issue and will
be sorted out later.  Given that only fsdax pages require the
notifiacation when the refcount hits 1 now, the PAGEMAP_OPS Kconfig
symbol can go away and be replaced with a FS_DAX check for this hook
in the put_page fastpath.

Based on an earlier patch from Ralph Campbell <[email protected]>.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Logan Gunthorpe <[email protected]>
Reviewed-by: Ralph Campbell <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Dan Williams <[email protected]>
Acked-by: Felix Kuehling <[email protected]>
Tested-by: "Sierra Guiza, Alejandro (Alex)" <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Alistair Popple <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Chaitanya Kulkarni <[email protected]>
Cc: Christian Knig <[email protected]>
Cc: Karol Herbst <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: "Pan, Xinhui" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
13 files changed:
arch/powerpc/kvm/book3s_hv_uvmem.c
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
drivers/gpu/drm/nouveau/nouveau_dmem.c
fs/Kconfig
include/linux/memremap.h
include/linux/mm.h
lib/test_hmm.c
mm/Kconfig
mm/internal.h
mm/memcontrol.c
mm/memremap.c
mm/migrate.c
mm/swap.c
This page took 0.073462 seconds and 4 git commands to generate.