From patchwork Sat Jul 16 08:18:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12919980 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22B97C43334 for ; Sat, 16 Jul 2022 08:18:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 471C58E0011; Sat, 16 Jul 2022 04:18:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 421558E0001; Sat, 16 Jul 2022 04:18:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30F178E0011; Sat, 16 Jul 2022 04:18:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 1FBFB8E0001 for ; Sat, 16 Jul 2022 04:18:30 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id CEFDC355D1 for ; Sat, 16 Jul 2022 08:18:29 +0000 (UTC) X-FDA: 79692261138.13.01212A6 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf06.hostedemail.com (Postfix) with ESMTP id C3E92180040 for ; Sat, 16 Jul 2022 08:18:28 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LlLdb29dKzjWy9; Sat, 16 Jul 2022 16:15:47 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 16 Jul 2022 16:18:25 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm: remove unneeded PageAnon check in restore_exclusive_pte() Date: Sat, 16 Jul 2022 16:18:16 +0800 Message-ID: <20220716081816.10752-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657959509; a=rsa-sha256; cv=none; b=n9DpOh+Rh8clqWvoHwdOb/gM3UD8HZjVFnYIurcg3Rn1jcLylDUtsCFpVGthDTEh28y9qT dnepscDI21D1U926phTDCGUPgmFRsFss2+Y6+zKssMORDMbPgHQMP0YoGwjDXu9bg+JN0w NL9BWfwyUbemD9f/jhh66Tlb8xdx7EI= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657959509; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=SILAVdZmGIgj1VihQlLEqQszJXYpLBTvK23Qv7/7lqg=; b=yxq+hQuABnk8+NtMof7f5Rp2WM2JYtpiA7V4PnXvzFQtuJeNYOVTkk7cEN1TXyodG0fJWe diLnxu9MzkuOPRypKdAIym/EOm8fcdlkASCM9h10pSkOhG9lmwJPJ7b0YAv2OgJi7M1tzr APxwG4alK2WH2gRMCg3w1GelhHrdE2A= X-Rspamd-Queue-Id: C3E92180040 Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam05 X-Rspam-User: X-Stat-Signature: he4emdgtu5tfd5zd6tfipiutwuw41uuc X-HE-Tag: 1657959508-97000 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When code reaches here, the page must be !PageAnon. There's no need to check PageAnon again. Remove it. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index f671b2dce1fe..d98f89cee3e9 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -753,7 +753,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);