From 31e9a712d1adee36fa9e015f01af933683d920bc Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 31 May 2022 10:27:42 -0700 Subject: [PATCH] mm-handling-non-lru-pages-returned-by-vm_normal_pages-fix adjust comment positioning, fix typo Cc: Alex Sierra Signed-off-by: Andrew Morton --- mm/memory.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index c905fabddeec..cc3c8ed45d15 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -632,14 +632,15 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, return NULL; if (is_zero_pfn(pfn)) return NULL; + /* + * NOTE: New users of ZONE_DEVICE will not set pte_devmap() and + * will have refcounts incremented on their struct pages when + * they are inserted into PTEs, thus they are safe to return + * here. Legacy ZONE_DEVICE pages that set pte_devmap() do not + * have refcounts. Example of legacy ZONE_DEVICE is + * MEMORY_DEVICE_FS_DAX type in pmem or virtio_fs drivers. + */ if (pte_devmap(pte)) -/* - * NOTE: New uers of ZONE_DEVICE will not set pte_devmap() and will have - * refcounts incremented on their struct pages when they are inserted into - * PTEs, thus they are safe to return here. Legacy ZONE_DEVICE pages that set - * pte_devmap() do not have refcounts. Example of legacy ZONE_DEVICE is - * MEMORY_DEVICE_FS_DAX type in pmem or virtio_fs drivers. - */ return NULL; print_bad_pte(vma, addr, pte, NULL); -- 2.50.1