-
- Downloads
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 <rcampbell@nvidia.com>. Link: https://lkml.kernel.org/r/20220210072828.2930359-8-hch@lst.de Signed-off-by:Christoph Hellwig <hch@lst.de> Reviewed-by:
Logan Gunthorpe <logang@deltatee.com> Reviewed-by:
Ralph Campbell <rcampbell@nvidia.com> Reviewed-by:
Jason Gunthorpe <jgg@nvidia.com> Reviewed-by:
Dan Williams <dan.j.williams@intel.com> Acked-by:
Felix Kuehling <Felix.Kuehling@amd.com> Tested-by:
"Sierra Guiza, Alejandro (Alex)" <alex.sierra@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Alistair Popple <apopple@nvidia.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Chaitanya Kulkarni <kch@nvidia.com> Cc: Christian Knig <christian.koenig@amd.com> Cc: Karol Herbst <kherbst@redhat.com> Cc: Lyude Paul <lyude@redhat.com> Cc: Miaohe Lin <linmiaohe@huawei.com> Cc: Muchun Song <songmuchun@bytedance.com> Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Matthew Wilcox (Oracle) <willy@infradead.org>
Showing
- arch/powerpc/kvm/book3s_hv_uvmem.c 0 additions, 1 deletionarch/powerpc/kvm/book3s_hv_uvmem.c
- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c 0 additions, 1 deletiondrivers/gpu/drm/amd/amdkfd/kfd_migrate.c
- drivers/gpu/drm/nouveau/nouveau_dmem.c 0 additions, 1 deletiondrivers/gpu/drm/nouveau/nouveau_dmem.c
- fs/Kconfig 0 additions, 1 deletionfs/Kconfig
- include/linux/memremap.h 5 additions, 7 deletionsinclude/linux/memremap.h
- include/linux/mm.h 3 additions, 3 deletionsinclude/linux/mm.h
- lib/test_hmm.c 0 additions, 1 deletionlib/test_hmm.c
- mm/Kconfig 0 additions, 4 deletionsmm/Kconfig
- mm/internal.h 2 additions, 0 deletionsmm/internal.h
- mm/memcontrol.c 3 additions, 8 deletionsmm/memcontrol.c
- mm/memremap.c 19 additions, 38 deletionsmm/memremap.c
- mm/migrate.c 0 additions, 6 deletionsmm/migrate.c
- mm/swap.c 4 additions, 12 deletionsmm/swap.c
Loading
Please register or sign in to comment