From patchwork Sat Jun 11 08:47:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12878370 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 3B6E8C433EF for ; Sat, 11 Jun 2022 08:47:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABDD68D010F; Sat, 11 Jun 2022 04:47:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A6D708D010E; Sat, 11 Jun 2022 04:47:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 90DD78D010F; Sat, 11 Jun 2022 04:47:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7E8FC8D00F7 for ; Sat, 11 Jun 2022 04:47:32 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 52898801C5 for ; Sat, 11 Jun 2022 08:47:32 +0000 (UTC) X-FDA: 79565326344.03.E965460 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf23.hostedemail.com (Postfix) with ESMTP id 64FE6140059 for ; Sat, 11 Jun 2022 08:47:31 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LKrz728B9zjX0R; Sat, 11 Jun 2022 16:46:27 +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, 11 Jun 2022 16:47:27 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , Subject: [PATCH 1/7] mm/khugepaged: remove unneeded shmem_huge_enabled() check Date: Sat, 11 Jun 2022 16:47:25 +0800 Message-ID: <20220611084731.55155-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220611084731.55155-1-linmiaohe@huawei.com> References: <20220611084731.55155-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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654937252; a=rsa-sha256; cv=none; b=ycMrmkTMSx9mW2U0jgujuLvvA7WbivgtA6M6kP1tdaa6evUUXxRvUTXZacrVN2vtiOC7sV R6tAp0Qpenrg0bd8PiKzWtoo70om34UusXVNhh/YjXAnBzT25IIFMdf0I3r6UygR2N1O6G B1Ldmxl7tG8GrnFAIqtpCHQ3qAxKZXM= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf23.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654937252; 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=xJRBn267w54p9IbB6lOSHEVhfWB/FWSqWLVJQc+TgwA=; b=oSO4gd4cpepjwOMDC3VfXnVuN57eltJJnNReB65/3J3U7m/vjzhSk5Ku/+sAY3C5D/Fj9N nIfZnRbBbqsOVPWUyhpmSqs62VSj+xOc6yh4jiu5ODd39lT0Qjrh9LkrDOEvWjZxM+6yKT buiOr3XxL7+LzK3UYggP/TgGYBNYoAM= X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 64FE6140059 Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf23.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: 5w4gjhfize3697kizdeupnmpbdgeb1c5 X-HE-Tag: 1654937251-146338 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, hugepage_vma_check() has already made sure that hugepage is enabled for shmem. Remove this duplicated check. Signed-off-by: Miaohe Lin Reviewed-by: Zach O'Keefe Reviewed-by: Yang Shi --- mm/khugepaged.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 476d79360101..73570dfffcec 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -2153,8 +2153,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;