OSDN Git Service

mm: remove unneeded PageAnon check in restore_exclusive_pte()
authorMiaohe Lin <linmiaohe@huawei.com>
Sat, 16 Jul 2022 08:18:16 +0000 (16:18 +0800)
committerakpm <akpm@linux-foundation.org>
Sat, 30 Jul 2022 01:07:16 +0000 (18:07 -0700)
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>
mm/memory.c

index 8c193b3..684c4c7 100644 (file)
@@ -744,7 +744,7 @@ static void restore_exclusive_pte(struct vm_area_struct *vma,
                 * 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);