From patchwork Tue Sep 15 12:59:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 11776507 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 52B65746 for ; Tue, 15 Sep 2020 13:02:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D732F20684 for ; Tue, 15 Sep 2020 13:02:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.b="oRGDCwZR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D732F20684 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 12E2F90003E; Tue, 15 Sep 2020 09:02:09 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0B5D890003A; Tue, 15 Sep 2020 09:02:09 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E72FE90003E; Tue, 15 Sep 2020 09:02:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id CEA5790003A for ; Tue, 15 Sep 2020 09:02:08 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 703244DBC for ; Tue, 15 Sep 2020 13:02:08 +0000 (UTC) X-FDA: 77265308736.29.coat23_39008cb27111 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 6D27118085D08 for ; Tue, 15 Sep 2020 13:02:05 +0000 (UTC) X-Spam-Summary: 1,0,0,5ce87d1028e855c6,d41d8cd98f00b204,songmuchun@bytedance.com,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1311:1314:1345:1359:1431:1437:1515:1534:1540:1568:1711:1714:1730:1747:1777:1792:1981:2194:2196:2199:2200:2393:2559:2562:3138:3139:3140:3141:3142:3865:3866:4321:4385:5007:6120:6261:6653:6737:6738:10004:11026:11473:11657:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12895:12986:13069:13311:13357:13894:14096:14181:14384:14721:21080:21444:21451:21627:21990:30054,0,RBL:209.85.214.193:@bytedance.com:.lbl8.mailshell.net-62.2.0.100 66.100.201.201;04y81qtzqzjo3gug1ix5b6izx3568ypnn6nr7kxq8fh86xudnub4n7sotry7p1t.pi7s8n7uxhzurn4x9bahjgtopteskxzqh4ooe91ojx6dsx7mukgwd9argi6ggr4.4-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: coat23_39008cb27111 X-Filterd-Recvd-Size: 4483 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Sep 2020 13:01:56 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id y6so1304874plt.9 for ; Tue, 15 Sep 2020 06:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1xA5Zo5Cz4t/QRWNMyKZ9/SLQQOd42+iCFRWcfd6Pao=; b=oRGDCwZRQ6h95N0FMYtWzeohLlxHf+tvqEMCR9b+bfmN66PI1duhmvDTZ8TlGCuBHs /MUW77EE7IDPPQ/0AJNYfbVfTyC4PmWmB4Iu5c//emNCMvApNE9v6mOvYVb67WYI6WbT ahYPJ8GfNIz/CzaXlUSZMFy2zV0hKJWnc2HGmocO952ivhDn594Toa/vhUHzcLL62/1q cWq59xzcwSZP1FjMei3f89Z8couHpG2Jb9pw6CjMiEmP55LSQ6Zj6vQzJWa6tvYRvoEs jJIQ8TWzLaWDg/v2TkZGhmpJtexiIzjwW7tJI1av5VPI6OyjBO8dKZcUVr/G9FRgLlCk wqBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1xA5Zo5Cz4t/QRWNMyKZ9/SLQQOd42+iCFRWcfd6Pao=; b=a6gOd1szxZfPnho2+FJ9ud99O67yM6I1g7qWqchRTRWBo9/GGNWPjT7Y1wI04iXbU7 C9hqyczt8hJASn4tULxNCT+rowaFZaWIHMWnK1xkY/X4zp+3haB+Gvgnm17z9EmOefo2 mjBlZ09gxS2GeML4F/C5SF4FKWoXjRfThWbZs2xj9yOMQgoxlWe59sPxmHTr99yZn9h4 Zsnx2rVZiyU8eum5t1bCF5QTJWDM5yr1z85yGH2Gf6CAMthgmkzD8g6jjKyhGy2hTPx+ rL1OoG8NTcF07hEQO/grJo7lVt0Yp6KOpwCUjJo6pfb9YipFCqdvS6ToquAJ77N0LRhD WtCg== X-Gm-Message-State: AOAM533lZrGj85l58cHWmvaY4NFo0AllUsI22MQQL5hDHw61uTGx+flh kLreK5BuGU2EMtypbJR/Ui9+HA== X-Google-Smtp-Source: ABdhPJylXgRgPVmLfSJ8EZxe2tlUYRohlc+NN9//Q+cjPIxAl32Wi0QDL88uhLkUFkuCqwNGmR/FBA== X-Received: by 2002:a17:902:ba83:b029:d1:e5e7:be12 with SMTP id k3-20020a170902ba83b02900d1e5e7be12mr1623727pls.69.1600174915323; Tue, 15 Sep 2020 06:01:55 -0700 (PDT) Received: from localhost.bytedance.net ([103.136.220.66]) by smtp.gmail.com with ESMTPSA id w185sm14269855pfc.36.2020.09.15.06.01.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2020 06:01:54 -0700 (PDT) From: Muchun Song To: corbet@lwn.net, mike.kravetz@oracle.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, rdunlap@infradead.org, oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, almasrymina@google.com, rientjes@google.com Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Muchun Song Subject: [RFC PATCH 11/24] mm/hugetlb: Add vmemmap_pmd_huge macro for x86 Date: Tue, 15 Sep 2020 20:59:34 +0800 Message-Id: <20200915125947.26204-12-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20200915125947.26204-1-songmuchun@bytedance.com> References: <20200915125947.26204-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6D27118085D08 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 pmd_large instead of pmd_huge on x86, so we implement the vmemmap_pmd_huge macro. Signed-off-by: Muchun Song --- arch/x86/include/asm/hugetlb.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index f5e882f999cd..7c3eb60c2198 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h @@ -4,10 +4,17 @@ #include #include +#include #ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP #define VMEMMAP_HPAGE_SHIFT PMD_SHIFT #define arch_vmemmap_support_huge_mapping() boot_cpu_has(X86_FEATURE_PSE) + +#define vmemmap_pmd_huge vmemmap_pmd_huge +static inline bool vmemmap_pmd_huge(pmd_t *pmd) +{ + return pmd_large(*pmd); +} #endif #define hugepages_supported() boot_cpu_has(X86_FEATURE_PSE)