From patchwork Sat Jun 25 09:28:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12895281 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 CD56CCCA482 for ; Sat, 25 Jun 2022 09:28:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36A986B0122; Sat, 25 Jun 2022 05:28:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CB6C8E0296; Sat, 25 Jun 2022 05:28:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B9F96B0124; Sat, 25 Jun 2022 05:28:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0E8D46B0122 for ; Sat, 25 Jun 2022 05:28:25 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E074960A0F for ; Sat, 25 Jun 2022 09:28:24 +0000 (UTC) X-FDA: 79616232528.27.C0BF952 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf11.hostedemail.com (Postfix) with ESMTP id F0B3240021 for ; Sat, 25 Jun 2022 09:28:23 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LVT900xS6zShC8; Sat, 25 Jun 2022 17:24:52 +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, 25 Jun 2022 17:28:18 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , , , Subject: [PATCH v2 1/7] mm/khugepaged: remove unneeded shmem_huge_enabled() check Date: Sat, 25 Jun 2022 17:28:10 +0800 Message-ID: <20220625092816.4856-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220625092816.4856-1-linmiaohe@huawei.com> References: <20220625092816.4856-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656149304; 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=TQK0fmIQ5Rz8ffzVmFtmAaBYfQoAvZRCcSWC1igCZEs=; b=mdAH7rM1CyBcs9twMrmcjJmMeUqaPDZJ4YI5f3yIkJ3DYB/J4gqn8PJZieXtmqns3SE6wb sjb/FmWPi8yPaoxR0APRfa9MXDqE2QRb1+1HXyr2uXC4viXcKwnxPs3+v0+2axR+3kOH6y URYPs027kR7nWcKCPiwWpNtYgwXpZFE= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 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=1656149304; a=rsa-sha256; cv=none; b=F+fILQutq6ThOXyeSId368bEJN2ObggV+G6j6kKdak6SBgni31YLWqEpx007YeDrC/IQG3 u0CF1aOiEG5AT/IIwLmxntRH9MCMa4fZHP7/LvU6KTJQLMPovAHJfksAW0T/LbZ4N1G426 UidR33ICUwI9bV6PoXf3QdRaqfiVvMU= Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: ot87st339kxpb3xs1bn3kiiom8feeix4 X-Rspamd-Queue-Id: F0B3240021 X-HE-Tag: 1656149303-891444 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: If we reach here, khugepaged_scan_mm_slot() has already made sure that hugepage is enabled for shmem, via its call to hugepage_vma_check(). Remove this duplicated check. Signed-off-by: Miaohe Lin Reviewed-by: Yang Shi Reviewed-by: Zach O'Keefe --- mm/khugepaged.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index d8ebb60aae36..8a103e0f8d2b 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -2119,8 +2119,6 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages, if (khugepaged_scan.address < hstart) khugepaged_scan.address = hstart; VM_BUG_ON(khugepaged_scan.address & ~HPAGE_PMD_MASK); - if (shmem_file(vma->vm_file) && !shmem_huge_enabled(vma)) - goto skip; while (khugepaged_scan.address < hend) { int ret;