Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3014437rwi; Fri, 21 Oct 2022 10:24:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6roe+1jVJ1poHnY3ptFuEkjYvp81A8ikHsM4FCowmy1ZmHQGaHfh46WBGu0/W3BNGfoiMN X-Received: by 2002:a17:902:e1ca:b0:186:878e:3b03 with SMTP id t10-20020a170902e1ca00b00186878e3b03mr602249pla.95.1666373065758; Fri, 21 Oct 2022 10:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666373065; cv=none; d=google.com; s=arc-20160816; b=wOEhyOH5UManCJmhbEQKrnYOWPJ1Uaxep6x8GbEHcW6Oi19fY95zrkcjIKqi2qsYp1 R9gChp78GUzUQwNGv7x4CLaFZQLLMHUAnwbB5BV+efJR9mjvDijtw0lmbqH4zTzqIfJ5 nM9rOqn0fjKUGi7A4wMCWuLomiUM1gBlm2wzdXVq5adUkkGGqw/G/tmPSqmQfbcAeGa/ Pmz2tDRaqyegkwcR8QJm2OiOv3/WB426P1iKUn3l3rnmh9mYHxUoPvCV7QLFX0mLg9zG x/V7P+Mc8pTa14Gasar/UrdlkJz10pm10xBgvfQbqM+4eLRhUEJJQAV86npnk+3ts//V ZOLw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a654303000000b00430980f6062si26760976pgq.351.2022.10.21.10.24.12; Fri, 21 Oct 2022 10:24:25 -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 + 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 ); 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 ; Fri, 21 Oct 2022 09:37:24 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-367dc159c2fso33838717b3.19 for ; 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 To: Mike Kravetz , Muchun Song , Peter Xu Cc: David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , "Zach O'Keefe" , Manish Mishra , Naoya Horiguchi , "Dr . David Alan Gilbert" , "Matthew Wilcox (Oracle)" , Vlastimil Babka , Baolin Wang , Miaohe Lin , Yang Shi , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 + config MEMFD_CREATE def_bool TMPFS || HUGETLBFS -- 2.38.0.135.g90850a2211-goog