The patch titled Subject: mm: remove unneeded PageAnon check in restore_exclusive_pte() has been added to the -mm mm-unstable branch. Its filename is mm-remove-unneeded-pageanon-check-in-restore_exclusive_pte.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-remove-unneeded-pageanon-check-in-restore_exclusive_pte.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Miaohe Lin <linmiaohe@xxxxxxxxxx> Subject: mm: remove unneeded PageAnon check in restore_exclusive_pte() Date: Sat, 16 Jul 2022 16:18:16 +0800 When code reaches here, the page must be !PageAnon. There's no need to check PageAnon again. Remove it. Link: https://lkml.kernel.org/r/20220716081816.10752-1-linmiaohe@xxxxxxxxxx Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx> Reviewed-by: David Hildenbrand <david@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memory.c~mm-remove-unneeded-pageanon-check-in-restore_exclusive_pte +++ a/mm/memory.c @@ -753,7 +753,7 @@ static void restore_exclusive_pte(struct * Currently device exclusive access only supports anonymous * memory so the entry shouldn't point to a filebacked page. */ - WARN_ON_ONCE(!PageAnon(page)); + WARN_ON_ONCE(1); set_pte_at(vma->vm_mm, address, ptep, pte); _ Patches currently in -mm which might be from linmiaohe@xxxxxxxxxx are mm-hugetlb-avoid-corrupting-page-mapping-in-hugetlb_mcopy_atomic_pte.patch mm-page_alloc-minor-clean-up-for-memmap_init_compound.patch mm-mmapc-fix-missing-call-to-vm_unacct_memory-in-mmap_region.patch filemap-minor-cleanup-for-filemap_write_and_wait_range.patch mm-remove-obsolete-comment-in-do_fault_around.patch mm-remove-unneeded-pageanon-check-in-restore_exclusive_pte.patch