From patchwork Fri Aug 26 09:24:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12955715 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 1BBBFECAAD2 for ; Fri, 26 Aug 2022 09:25:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BE386B0085; Fri, 26 Aug 2022 05:25:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36DFC6B0087; Fri, 26 Aug 2022 05:25:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C0BB6B0088; Fri, 26 Aug 2022 05:25:00 -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 087396B0085 for ; Fri, 26 Aug 2022 05:25:00 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D7439A0E85 for ; Fri, 26 Aug 2022 09:24:59 +0000 (UTC) X-FDA: 79841209518.02.D44D2D2 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf21.hostedemail.com (Postfix) with ESMTP id 4F0951C001C for ; Fri, 26 Aug 2022 09:24:59 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MDZ8M0VRqz19VLD; Fri, 26 Aug 2022 17:21:23 +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; Fri, 26 Aug 2022 17:24:55 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH 09/10] hugetlb: remove meaningless BUG_ON(huge_pte_none()) Date: Fri, 26 Aug 2022 17:24:21 +0800 Message-ID: <20220826092422.39591-10-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220826092422.39591-1-linmiaohe@huawei.com> References: <20220826092422.39591-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661505899; a=rsa-sha256; cv=none; b=CCQVwtybMZNXaSANJqPrbMyfKauIy6YsuGoBDcZbonqjGMezdMu3fTrQULkb60VgmK8RfS mCrUauiv1NJq1dQmGPld9+30nimARxw0Vz2KLjKZ2/LEI9J2zOWRSEggk6X6HurU24P9aF 6dcz35P3I5Rdu3j8IZCKbqCSncTNUVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661505899; 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:in-reply-to:references:references; bh=4/Q1dzTsEtXdXQGQHwX+EJ1/GUlZJBOJJYfJqlK3H+U=; b=vdStXTj5ikzEMX+z6MCcmgJDf2nn1nc+yanvrSR/djz5+SPbdBjkRpBKN7RAeohpQ5/FkE svin5nyteNu9Ocfzy67d7JPg+wja3MOfUqKi/ASYYXREGfqd5DOZIy6dAgDQVxu0zLzWzR 1O7oPGqOVn/KI60ZISyTeYFIbMYjDi8= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4F0951C001C X-Rspam-User: X-Stat-Signature: 9ckrbispwifijyfuzcib34mtam1odupg Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1661505899-82161 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, invalid page would have been accessed if huge pte is none. So this BUG_ON(huge_pte_none()) is meaningless. Remove it. Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song --- mm/hugetlb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index b432a00061e3..0ef26dbdc7f8 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5374,7 +5374,6 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, u32 hash; put_page(old_page); - BUG_ON(huge_pte_none(pte)); /* * Drop hugetlb_fault_mutex and vma_lock before * unmapping. unmapping needs to hold vma_lock