Message ID | 20230105101844.1893104-40-jthoughton@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp228204wrt; Thu, 5 Jan 2023 02:24:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXspbIF5TwF+S5J9Xd95+rxhymzfBojJ2FuUyfMEOjDCD51PBjFoL6Jbc+1EogghKpjgNa0I X-Received: by 2002:a17:90b:92:b0:225:eda7:13e with SMTP id bb18-20020a17090b009200b00225eda7013emr37550416pjb.40.1672914241243; Thu, 05 Jan 2023 02:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672914241; cv=none; d=google.com; s=arc-20160816; b=FcRvG0amKh71d1ujNEwdVnwEvZsv6t93ckFFDUhNiy6x0rZKCRsv//ieCgo4tRuj2c C7TuRDU+DwD44wLuFzTt8EEpGpyOZbTWd+ZK5muoPzHASnCqGCeV9TFq5PvhoMCZkCJw l9P0lA/sMXsJzJnTjQPVQGz0lq3nvlZ3eC0XUf0iVMlHSprqd4dcb5IUYuAVFfYOe62D ZUjB8kZp63Y37wShVpCAfmblKi2ouLMqesUf45oIzsvWTtUcVp56pWMtsdaL/YtpR/LH atOddZJjscM+CdNe7xFB186lRdura2fRQ0RXmV8i4dfSCC9CiWCRwVnca3iEiViddNdY dwPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=ebd8Vu/XVboNQYDKBTu4hK6f3y9obuZPyqPY5k+Gudc=; b=gBjzKbur9nLW7X0T4T6PEolIEdF7mBuOdMyo4vXlpWmfmbxrCw5Obh02CUzvVKKFCM DXfo+Zo2uEmm0bVVGjEaw+IUF0PkR5CQl7sk2Y34PI7JM9JleblvSpvBC3rcWxHSw3Lf fK3iWh31YEuVkyMJYU9pv4EDXOBhcicKkPnvPNYSaW7Tm3fACHkAgMvo6qTdAr0w4Nof Z/uyT3K3/S39lNnhellI6bW3VdTJEzNRRxnaYWWHVN2oV+jJ/blg0Y5kAJs+pTVaH6hc qE1lXmPiTWIAhp+HxB/KhANrv6NG+z6Z+V2+IMRdoPMalEPGGMxlZyGy3UXNFZR5p/Q/ 6iUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=I6ayK2fj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb3-20020a17090ae7c300b00215dedefc32si1702241pjb.163.2023.01.05.02.23.48; Thu, 05 Jan 2023 02:24:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=I6ayK2fj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232821AbjAEKXK (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Thu, 5 Jan 2023 05:23:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231444AbjAEKVu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 5 Jan 2023 05:21:50 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0924C559FF for <linux-kernel@vger.kernel.org>; Thu, 5 Jan 2023 02:19:52 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-45c1b233dd7so377526717b3.20 for <linux-kernel@vger.kernel.org>; Thu, 05 Jan 2023 02:19:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ebd8Vu/XVboNQYDKBTu4hK6f3y9obuZPyqPY5k+Gudc=; b=I6ayK2fjeeV6XAYAV3ZhwaEnnQoYUdQNqveqXyF5ggg1QXVgf5LPqhurqUyX4Sg8HO s6F9jORt3w8TrKLgQbE9o/ipsILjWJVWxOlolxXAYaC7l1LUJTPuzmnYXb8M/6TAOgE6 iV4jd4Plk12mL7A8sfE6TF+7lw9HKJSmcmSdh24PWpxCGN5c8WUgHm+WCIlfPdcQb8Va oaa3biXUtYUW2lT6cUJ+TJCPkPPPYnk+RY3IQZ7J1RSQZAg/BMdpqELg44GmDZbqhD/+ kIK71fstpMvWu1m6mR114A35MUphScUHv/CK8JATL1Z7Dr//wEo/gsARlq+dXyJGqPZ3 FyGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ebd8Vu/XVboNQYDKBTu4hK6f3y9obuZPyqPY5k+Gudc=; b=l3QEQnfbLZIhrBeIPKwd5JBPSmYWi/PpvsT87VR/6ahjoOcjnJPCI1cqs+ww7HLVAS 3oJyLhlUvWqqAtoulhXWtCIX5AvgYmZdSWkOaITaWUI2p0IXVXvkxRNF51VD0e0UPoR2 sTIslCTqodunu1zMg08/X8v6fLB+MQYXP19V+rtBhF2HqXwWH7CqCsPCsjUEHwXR+ou8 TdGeGvvqqg0zjKq3vRvSK23hPvg0ne3LMECKBwm2dTNUQYDdksiuEfhZP5azeOrvhS9i LAN4Z0+5+kcdUqS0d64s0XtJlIVdz/JoqwK8OowGHKksWSa8H+Knd4mPQslhbFYZPah1 8ZGw== X-Gm-Message-State: AFqh2kppfkQxpLcC5D67Fy7GE3bYkaATXRjkpemiAYPmJ+vUaX8pc5Eo Fh2wNOl3eGRVn/1lWZ5iKr1zeoV0I1i5ZxGH X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a05:690c:c81:b0:48c:9ce1:9ac8 with SMTP id cm1-20020a05690c0c8100b0048c9ce19ac8mr2452166ywb.305.1672913991340; Thu, 05 Jan 2023 02:19:51 -0800 (PST) Date: Thu, 5 Jan 2023 10:18:37 +0000 In-Reply-To: <20230105101844.1893104-1-jthoughton@google.com> Mime-Version: 1.0 References: <20230105101844.1893104-1-jthoughton@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230105101844.1893104-40-jthoughton@google.com> Subject: [PATCH 39/46] hugetlb: x86: enable high-granularity mapping From: James Houghton <jthoughton@google.com> To: Mike Kravetz <mike.kravetz@oracle.com>, Muchun Song <songmuchun@bytedance.com>, Peter Xu <peterx@redhat.com> Cc: David Hildenbrand <david@redhat.com>, David Rientjes <rientjes@google.com>, Axel Rasmussen <axelrasmussen@google.com>, Mina Almasry <almasrymina@google.com>, "Zach O'Keefe" <zokeefe@google.com>, Manish Mishra <manish.mishra@nutanix.com>, Naoya Horiguchi <naoya.horiguchi@nec.com>, "Dr . David Alan Gilbert" <dgilbert@redhat.com>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Vlastimil Babka <vbabka@suse.cz>, Baolin Wang <baolin.wang@linux.alibaba.com>, Miaohe Lin <linmiaohe@huawei.com>, Yang Shi <shy828301@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton <jthoughton@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754177723524853857?= X-GMAIL-MSGID: =?utf-8?q?1754177723524853857?= |
Series |
Based on latest mm-unstable (85b44c25cd1e).
|
|
Commit Message
James Houghton
Jan. 5, 2023, 10:18 a.m. UTC
Now that HGM is fully supported for GENERAL_HUGETLB, x86 can enable it.
The x86 KVM MMU already properly handles HugeTLB HGM pages (it does a
page table walk to determine which size to use in the second-stage page
table instead of, for example, checking vma_mmu_pagesize, like arm64
does).
We could also enable HugeTLB HGM for arm (32-bit) at this point, as it
also uses GENERAL_HUGETLB and I don't see anything else that is needed
for it. However, I haven't tested on arm at all, so I won't enable it.
Signed-off-by: James Houghton <jthoughton@google.com>
---
arch/x86/Kconfig | 1 +
1 file changed, 1 insertion(+)
Comments
On Thu, Jan 5, 2023 at 5:19 AM James Houghton <jthoughton@google.com> wrote: > > Now that HGM is fully supported for GENERAL_HUGETLB, x86 can enable it. > The x86 KVM MMU already properly handles HugeTLB HGM pages (it does a > page table walk to determine which size to use in the second-stage page > table instead of, for example, checking vma_mmu_pagesize, like arm64 > does). > > We could also enable HugeTLB HGM for arm (32-bit) at this point, as it > also uses GENERAL_HUGETLB and I don't see anything else that is needed > for it. However, I haven't tested on arm at all, so I won't enable it. Given that we are using a high bit for VM_HUGETLB_HGM, we can only support 64-bit architectures. Userfaultfd minor faults is limited to 64-bit architectures for the same reason: VM_UFFD_MINOR uses a bit. > > Signed-off-by: James Houghton <jthoughton@google.com> > --- > arch/x86/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 3604074a878b..3d08cd45549c 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -126,6 +126,7 @@ config X86 > select ARCH_WANT_GENERAL_HUGETLB > select ARCH_WANT_HUGE_PMD_SHARE > select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP if X86_64 > + select ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING This needs `if X86_64` at the end. Will be corrected for v2. > select ARCH_WANT_LD_ORPHAN_WARN > select ARCH_WANTS_THP_SWAP if X86_64 > select ARCH_HAS_PARANOID_L1D_FLUSH > -- > 2.39.0.314.g84b9a713c41-goog >
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 3604074a878b..3d08cd45549c 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -126,6 +126,7 @@ config X86 select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP if X86_64 + select ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANTS_THP_SWAP if X86_64 select ARCH_HAS_PARANOID_L1D_FLUSH