Message ID | 20221021163703.3218176-8-jthoughton@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 E1F20C433FE for <linux-mm@archiver.kernel.org>; Fri, 21 Oct 2022 16:37:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AA988E000A; Fri, 21 Oct 2022 12:37:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85A298E0001; Fri, 21 Oct 2022 12:37:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FB628E000A; Fri, 21 Oct 2022 12:37:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 617C48E0001 for <linux-mm@kvack.org>; Fri, 21 Oct 2022 12:37:24 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4624AC0139 for <linux-mm@kvack.org>; Fri, 21 Oct 2022 16:37:24 +0000 (UTC) X-FDA: 80045512008.02.4EEBA8D Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf09.hostedemail.com (Postfix) with ESMTP id F2BAA14003A for <linux-mm@kvack.org>; Fri, 21 Oct 2022 16:37:23 +0000 (UTC) Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-367f94b9b16so33986027b3.11 for <linux-mm@kvack.org>; Fri, 21 Oct 2022 09:37:23 -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=YGFug9D/sOnYEDlAqRTj70banyELVGGOslOkLCWLDOzZB01H9NVUHMx09tud+mNNTn rhhzuISDlDnUornOVjvwNO0BPXdudmFvzux+NMaKwNB4tPi4XB1HfN6L118I+fnJP9WQ VQyJROb2NIvjtsOl+/8eJvTObFlrTxZKtzEOOsw7i0WqCQP3ezz25S+tgSiC5BdFBnui 03Osm3NpecRQXfEmHiwMJzLjudxBZryiXxkraAS2Ft6wM7QuA0kdmObjrJQN1JWxm3t4 gv15MTOmhCG/RAu6+zjDD15t+lTmsgmXsX3r516KsEN6vMcq5PMo3bvUfVccot/PmV/p xeog== X-Gm-Message-State: ACrzQf1vSmaIXvbtwqoFBDk7/uBf0KoOygj8VAFhn6p9zG+qkUPsKSUP lZxijqJL88MLNIwUJC5AMpbV81a7PNxhbuiJ X-Google-Smtp-Source: AMsMyM4vp8fYTq3qDzC4UTof6qxcqVOi/s+AdXdyXBlWQIteH9csXgDzlKMfMAxWzbToL+1hNLKr/pzgUDQtkmZ8 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" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666370244; a=rsa-sha256; cv=none; b=vLBqJtd6PSezGwFTH3OHO/fRa7Mi6eOrH9GX3QCM1sum/fkwbNbMCQP9TNut7jFuBOIVXY 9F3yqCRzc1XCyAaj04ulGFGxgrC8MmTR1IIA4yINVosIiVpuJc9cZjM14PwR/szjQ/xU5K kKWWo2MfmYkNcfUCQmSsTTZ/iSJtucQ= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=KyHaYNZ4; spf=pass (imf09.hostedemail.com: domain of 3w8pSYwoKCMQt3ry4qr3yxqyyqvo.mywvsx47-wwu5kmu.y1q@flex--jthoughton.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3w8pSYwoKCMQt3ry4qr3yxqyyqvo.mywvsx47-wwu5kmu.y1q@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666370244; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IUxkfzPpYKN6asWxOUK5hNSN6fMNkS8/sAXTNszQZDU=; b=tgGeq1B1149fO+stjotP9D2wnArLtyAyKJZl3K35IFKaNJL4ziSFYFalUVNLzBtC4+1+jT toE1f9a65b519KsvfiUbSqlm+JkWccqODCh/0pG16NDwWfxqCq0gUY/idgKCSJocz5fOGV z5ugU3/CRtcFNhhOxhe1ZCnuHXWnPgI= X-Stat-Signature: zpj3bbhr8rewyo58dsw49a8iq891ucgn X-Rspamd-Queue-Id: F2BAA14003A Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=KyHaYNZ4; spf=pass (imf09.hostedemail.com: domain of 3w8pSYwoKCMQt3ry4qr3yxqyyqvo.mywvsx47-wwu5kmu.y1q@flex--jthoughton.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3w8pSYwoKCMQt3ry4qr3yxqyyqvo.mywvsx47-wwu5kmu.y1q@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1666370243-213749 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: <linux-mm.kvack.org> |
Series |
hugetlb: introduce HugeTLB high-granularity mapping
|
expand
|
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
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(+)