From: Andrew Morton Date: Tue, 31 May 2022 17:27:42 +0000 (-0700) Subject: mm-handling-non-lru-pages-returned-by-vm_normal_pages-fix X-Git-Tag: maple_v12_fixes~185 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=31e9a712d1adee36fa9e015f01af933683d920bc;p=users%2Fjedix%2Flinux-maple.git mm-handling-non-lru-pages-returned-by-vm_normal_pages-fix adjust comment positioning, fix typo Cc: Alex Sierra Signed-off-by: Andrew Morton --- 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);