From patchwork Tue Mar 30 14:02:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12172647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A803AC433C1 for ; Tue, 30 Mar 2021 14:03:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 29A08619CC for ; Tue, 30 Mar 2021 14:03:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29A08619CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 860AE6B007B; Tue, 30 Mar 2021 10:03:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 810E16B0080; Tue, 30 Mar 2021 10:03:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 700886B0082; Tue, 30 Mar 2021 10:03:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 576186B007B for ; Tue, 30 Mar 2021 10:03:28 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 189A9180AD820 for ; Tue, 30 Mar 2021 14:03:28 +0000 (UTC) X-FDA: 77976708096.40.924C100 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf18.hostedemail.com (Postfix) with ESMTP id 5584620007CE for ; Tue, 30 Mar 2021 14:03:24 +0000 (UTC) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F8rgr38ZTznWHt; Tue, 30 Mar 2021 22:00:40 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 30 Mar 2021 22:03:07 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 1/4] ksm: remove redundant VM_BUG_ON_PAGE() on stable_tree_search() Date: Tue, 30 Mar 2021 10:02:25 -0400 Message-ID: <20210330140228.45635-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20210330140228.45635-1-linmiaohe@huawei.com> References: <20210330140228.45635-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected X-Stat-Signature: nfbonr79pd36jf47bbdqd76y8hxjczyb X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5584620007CE Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=szxga04-in.huawei.com; client-ip=45.249.212.190 X-HE-DKIM-Result: none/none X-HE-Tag: 1617113004-242593 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: The same VM_BUG_ON_PAGE() check is already done in the callee. Remove these extra caller one to simplify code slightly. Signed-off-by: Miaohe Lin --- mm/ksm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 1f2c62e1d797..359afb3023b4 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1771,7 +1771,6 @@ static struct page *stable_tree_search(struct page *page) * stable_node_dup is the dup to replace. */ if (stable_node_dup == stable_node) { - VM_BUG_ON(is_stable_node_chain(stable_node_dup)); VM_BUG_ON(is_stable_node_dup(stable_node_dup)); /* chain is missing so create it */ stable_node = alloc_stable_node_chain(stable_node_dup, @@ -1785,7 +1784,6 @@ static struct page *stable_tree_search(struct page *page) * of the current nid for this page * content. */ - VM_BUG_ON(!is_stable_node_chain(stable_node)); VM_BUG_ON(!is_stable_node_dup(stable_node_dup)); VM_BUG_ON(page_node->head != &migrate_nodes); list_del(&page_node->list);