From patchwork Sat Jun 11 02:23:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12878315 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 2C7DDC433EF for ; Sat, 11 Jun 2022 02:23:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63ECD6B0139; Fri, 10 Jun 2022 22:23:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EE236B013A; Fri, 10 Jun 2022 22:23:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B6236B013B; Fri, 10 Jun 2022 22:23:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 392CA6B0139 for ; Fri, 10 Jun 2022 22:23:15 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0F2FE35E4D for ; Sat, 11 Jun 2022 02:23:15 +0000 (UTC) X-FDA: 79564357950.21.DA5E15A Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf24.hostedemail.com (Postfix) with ESMTP id A68C418006D for ; Sat, 11 Jun 2022 02:23:13 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LKhQh5mTLzgYHn; Sat, 11 Jun 2022 10:21:16 +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 10:23:09 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH] mm/shmem.c: use helper transhuge_vma_enabled() Date: Sat, 11 Jun 2022 10:23:14 +0800 Message-ID: <20220611022314.21593-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: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654914194; a=rsa-sha256; cv=none; b=jbZ7ax4c3oEMoSzQoVDtk6xYnSefiAvQgjMJL+lC0ZFQuTOMMGEhqRi1tci0JmmvFTDKaZ cR4MLWQFJ8rdDtnsDjZDHAma/5o6uN/lsSInNCGW9RztIlO57R2nh+Qt8CeuD7+lp/3CqN ZNmSZ/knvyKySZCtSmgSFCxkHjZKEE8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.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=1654914194; 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=Awq+rJ35zh3ShNJo+IT2PhxxyfOyo1s6LpoxYrfwBTI=; b=NXszfFYGrkk+LIIFLrKTGObXo/Wh1IuWUQCP+ZtUczfCOrFrfp/qYbGYhrNRLUsrGY2ILQ 0jFsl0b00j48hma3/aplLlMt/eRwxgbnB1Tpdq36in9CGqhOlWAQLSUtAFMZ0Iy5OEFJqU 2/cljzX86tUVAOWgLz2KjUZI9SvoyzQ= X-Stat-Signature: 46stb7cm8dous141xkeidp4htraca59o X-Rspamd-Queue-Id: A68C418006D X-Rspam-User: X-Rspamd-Server: rspam10 Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-HE-Tag: 1654914193-27733 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: Use helper transhuge_vma_enabled() to check whether transhuge is enable on vma. Minor readability improvement. Signed-off-by: Miaohe Lin --- mm/shmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 133c67057d41..59cc2e980c95 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -480,8 +480,7 @@ bool shmem_is_huge(struct vm_area_struct *vma, return false; if (shmem_huge == SHMEM_HUGE_DENY) return false; - if (vma && ((vma->vm_flags & VM_NOHUGEPAGE) || - test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags))) + if (vma && !transhuge_vma_enabled(vma, vma->vm_flags)) return false; if (shmem_huge == SHMEM_HUGE_FORCE) return true;