Message ID | 20221021163703.3218176-8-jthoughton@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp795187wrr; Fri, 21 Oct 2022 09:38:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60sCWxsSvc+1x5xNczaeNAl1kC+D3wNpLstJXihw8/EGkAUzzSINZGYgbqXbZSyKlpfQ2y X-Received: by 2002:a17:903:2410:b0:17a:b32:dbec with SMTP id e16-20020a170903241000b0017a0b32dbecmr20009880plo.163.1666370308388; Fri, 21 Oct 2022 09:38:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666370308; cv=none; d=google.com; s=arc-20160816; b=vOuUQm1tTd0CQOPtYnT2MN/x17AT8+9M92fpBZdVWRTfh98o1JnyQKkfCyi/hKsrDd kOKTc4+Npv64kBfi7rYneEjNtY/KJQ5CuT8rBIIPNVE3VLBAFawwzTFvXK0j7Mxkw1yd MSGZ49KPqgBZd+vw1XWgQRmBAQSlmiubbPg0HoXNP6P6ejEipp9RObKQrJCXXAyN9/Y+ 3Faw9LstGdOOAFEIwFddFQKJJGLreYoYvCXbOtCrESV2s6ND5WLAzB42196tuf3Y8eGS xyFdQPEm53GlnUSyROvx76S3SAESxPCL6reNLQhVTPB6/BN2GLk4hgelNZi4B2Q0/f7Z BFKg== 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=IUxkfzPpYKN6asWxOUK5hNSN6fMNkS8/sAXTNszQZDU=; b=Ok+01knSIfSuCYuz+WhB5H3W47RnMyrIk+9iP8P7h6T74NsjZW5MDXMlpcKQ+F0sdr PHYa8kLIWcKFvRKtWmAq8Y0cbnp00iru++fjt7w8yOnJmGq+ttLYZgSsAl3ehDMOlPm6 pmIlSHhZ2dGcYFLMDCReQD8oPYnl9ouMANWT8kMBAu292tHNZQGzhPHh8JfzljxkAYrg V/d4GdE1kZ78fq1mCLomUuED4SI8VB6J62fJMpJvC1vMtwboeermOJOVw7Z6lWQiL7Dh Zx9wR24YZcyBv6JmN5YFx/cxiH4sSr9RzGpkWj1GrL//i4dEMluy4eUyRbmXItK3R+MX tbDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=KyHaYNZ4; 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 c15-20020a056a00248f00b00543bc7e5bc9si25534249pfv.361.2022.10.21.09.38.15; Fri, 21 Oct 2022 09:38:28 -0700 (PDT) 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=KyHaYNZ4; 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 S230497AbiJUQhw (ORCPT <rfc822;mntrajkot1@gmail.com> + 99 others); Fri, 21 Oct 2022 12:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230421AbiJUQh3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Oct 2022 12:37:29 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A30AA27B560 for <linux-kernel@vger.kernel.org>; Fri, 21 Oct 2022 09:37:24 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-367dc159c2fso33838717b3.19 for <linux-kernel@vger.kernel.org>; Fri, 21 Oct 2022 09:37:24 -0700 (PDT) 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=IUxkfzPpYKN6asWxOUK5hNSN6fMNkS8/sAXTNszQZDU=; b=KyHaYNZ4pYGCB/ViwdCe6ocu1GDgb5YvODnNgAb9mCc41is/HzCKWGlBYl+zSC2M7R wDxY0MPGeDl4H+0C+mB6AFFSBWs3XZbwRg6SRGwAx5hUQbyU0q2y7YE3x3g1mN6R7kOL mmsmmdI260xt2gPS3NqKTeMLpZZsslNcjBFK0FPPuqtHMPONuhEMnH8tH2tsucIOb/sf djUB2qYtnGhphrore61r1cmnFMRrRh4uh4EhSpubCR4MBBVW+CoIXhmSmouk+6a8lUUx XMYWqrbERhGrTAQJzZPB/mpCFUGWWYrvH6mlo2sZFv3G70Q1lmcsgtXbK8JdDbqteunh HYwQ== 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=IUxkfzPpYKN6asWxOUK5hNSN6fMNkS8/sAXTNszQZDU=; b=gMkWMVwBAMjeZmC5mjvOl02uJNZTZLJ6Tfy5rg0H+wCm2MjZmSoL7j3Ixuu54he+Ol qnwcavChW1oXU0eFkUP0WvRCA7KMUWyYQ4d3fNlBYiqBgfXA+EoZpYLSWbb1EsYOjwO0 9wVCXua1XPTJPfNRxuhXAUcPTYvb7rvDSO8QSsr8MgvA+ZJ53rgkJNyVMCQcwhG/V6OX +cmWESx1E/Wl826M5vnQ1cx0bvoRHADYIWw32V15pIQWezj0l9sljOdxK2m69l9m3/7n JeZc6uKbvU51c3n7Mi93dboiiAiAwKMpl20MOB+KgbbDN1CgCaSfKIj4uuFk6qAOqZ8X /raw== X-Gm-Message-State: ACrzQf0KWd5sI6zwHhRvJ+ehCqlJxI62xQ/EqLcOnEnxvSAEdzGGnD6z nZOEDWsu+3ErMEFnYzg41EdnP+tp9jvdcWoc X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a25:790d:0:b0:670:6032:b1df with SMTP id u13-20020a25790d000000b006706032b1dfmr16600775ybc.629.1666370243225; Fri, 21 Oct 2022 09:37:23 -0700 (PDT) Date: Fri, 21 Oct 2022 16:36:23 +0000 In-Reply-To: <20221021163703.3218176-1-jthoughton@google.com> Mime-Version: 1.0 References: <20221021163703.3218176-1-jthoughton@google.com> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog Message-ID: <20221021163703.3218176-8-jthoughton@google.com> Subject: [RFC PATCH v2 07/47] hugetlb: add CONFIG_HUGETLB_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?1747315912432624788?= X-GMAIL-MSGID: =?utf-8?q?1747315912432624788?= |
Series |
hugetlb: introduce HugeTLB high-granularity mapping
|
|
Commit Message
James Houghton
Oct. 21, 2022, 4:36 p.m. UTC
This adds the Kconfig to enable or disable high-granularity mapping.
Each architecture must explicitly opt-in to it (via
ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING), but when opted in, HGM will
be enabled by default if HUGETLB_PAGE is enabled.
Signed-off-by: James Houghton <jthoughton@google.com>
---
fs/Kconfig | 7 +++++++
1 file changed, 7 insertions(+)
Comments
On 10/21/22 16:36, James Houghton wrote: > This adds the Kconfig to enable or disable high-granularity mapping. > Each architecture must explicitly opt-in to it (via > ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING), but when opted in, HGM will > be enabled by default if HUGETLB_PAGE is enabled. > > Signed-off-by: James Houghton <jthoughton@google.com> > --- > fs/Kconfig | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/Kconfig b/fs/Kconfig > index 2685a4d0d353..ce2567946016 100644 > --- a/fs/Kconfig > +++ b/fs/Kconfig > @@ -267,6 +267,13 @@ config HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON > enable HVO by default. It can be disabled via hugetlb_free_vmemmap=off > (boot command line) or hugetlb_optimize_vmemmap (sysctl). > > +config ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING > + bool > + > +config HUGETLB_HIGH_GRANULARITY_MAPPING > + def_bool HUGETLB_PAGE > + depends on ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING Might also need to make this depend on CONFIG_ARCH_WANT_HUGE_PMD_SHARE as the vma local allocation will only happen in this case.
diff --git a/fs/Kconfig b/fs/Kconfig index 2685a4d0d353..ce2567946016 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -267,6 +267,13 @@ config HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON enable HVO by default. It can be disabled via hugetlb_free_vmemmap=off (boot command line) or hugetlb_optimize_vmemmap (sysctl). +config ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING + bool + +config HUGETLB_HIGH_GRANULARITY_MAPPING + def_bool HUGETLB_PAGE + depends on ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING + config MEMFD_CREATE def_bool TMPFS || HUGETLBFS