From patchwork Thu Jun 30 04:32:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 12901037 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 CE1E3CCA47B for ; Thu, 30 Jun 2022 04:34:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39F056B0078; Thu, 30 Jun 2022 00:34:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 329AE6B007B; Thu, 30 Jun 2022 00:34:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1EF2F8E0001; Thu, 30 Jun 2022 00:34:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 106CB6B0078 for ; Thu, 30 Jun 2022 00:34:15 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id DD2C65BD for ; Thu, 30 Jun 2022 04:34:14 +0000 (UTC) X-FDA: 79633635228.14.94B1359 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf04.hostedemail.com (Postfix) with ESMTP id 7733C4001C for ; Thu, 30 Jun 2022 04:34:14 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3CACDB827F9; Thu, 30 Jun 2022 04:34:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3983EC34115; Thu, 30 Jun 2022 04:34:07 +0000 (UTC) From: Huacai Chen To: Arnd Bergmann , Huacai Chen , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , Andrew Morton , linux-mm@kvack.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Feiyang Chen , Huacai Chen Subject: [PATCH V2 4/4] LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP Date: Thu, 30 Jun 2022 12:32:37 +0800 Message-Id: <20220630043237.2059576-5-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220630043237.2059576-1-chenhuacai@loongson.cn> References: <20220630043237.2059576-1-chenhuacai@loongson.cn> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656563654; a=rsa-sha256; cv=none; b=sB0E3bpxnxicpqVBw3KYTiAkgOLOoonSRCE+CINMPTSaU3B5xRZxk802BYiJprfLM6pMJl gipfwUJbU4vgc8Yml3W4IdYXqWdOdCE9vEFsBvTJxy88ISEi3lnUTohBNaODhSbnnyUsSj QvfBsXCiogLB6zclfr1z+9Env9S/OVs= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of "SRS0=Dk8Y=XF=loongson.cn=chenhuacai@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=Dk8Y=XF=loongson.cn=chenhuacai@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656563654; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HcPfGMo9yq8rnng8rkEyYgJf7e79hPuTXrey5TTCR0k=; b=wf6EsrEse8MzxbthJuzJQPbYhjmhGJRkso0p0ieLqQr7q4aewECXYJ4HTO4lqRoJ4TILhL pCJkfrm+umxjAvOVbmCmOsTIN7k+Iwb05jQm3LXWKmDl5ntv3ji9gMhR2Db6g/eXEHiG2w m4Xi//gqvXJ+GpiCESVBxCMAoUg3fYc= X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 7733C4001C Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of "SRS0=Dk8Y=XF=loongson.cn=chenhuacai@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=Dk8Y=XF=loongson.cn=chenhuacai@kernel.org" X-Rspam-User: X-Stat-Signature: mjoiapeoge47nj9qkd14zf5948j7zkg9 X-HE-Tag: 1656563654-741893 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: From: Feiyang Chen The feature of minimizing overhead of struct page associated with each HugeTLB page is implemented on x86_64. However, the infrastructure of this feature is already there, so just select ARCH_WANT_HUGETLB_PAGE_ OPTIMIZE_VMEMMAP is enough to enable this feature for LoongArch. To avoid build error on LoongArch we should include linux/static_key.h in page-flags.h. Signed-off-by: Huacai Chen Signed-off-by: Feiyang Chen --- arch/loongarch/Kconfig | 1 + include/linux/page-flags.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 55ab84fd70e5..8e56ca28165e 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -49,6 +49,7 @@ config LOONGARCH select ARCH_USE_QUEUED_RWLOCKS select ARCH_USE_QUEUED_SPINLOCKS select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT + select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP select ARCH_WANTS_NO_INSTR select BUILDTIME_TABLE_SORT select COMMON_CLK diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index e66f7aa3191d..28a53ac7aa3e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -9,6 +9,7 @@ #include #include #include +#include #ifndef __GENERATING_BOUNDS_H #include #include