Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: remove unneeded PageAnon check in restore_exclusive_pte()

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@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Miaohe Lin and committed by
akpm
4d8ff640 9b7a4039

+1 -1
+1 -1
mm/memory.c
··· 744 744 * Currently device exclusive access only supports anonymous 745 745 * memory so the entry shouldn't point to a filebacked page. 746 746 */ 747 - WARN_ON_ONCE(!PageAnon(page)); 747 + WARN_ON_ONCE(1); 748 748 749 749 set_pte_at(vma->vm_mm, address, ptep, pte); 750 750