From patchwork Fri Jun 24 17:36:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 12894931 Return-Path: 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 84F7BC433EF for ; Fri, 24 Jun 2022 17:37:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D9D68E0245; Fri, 24 Jun 2022 13:37:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7122C8E0244; Fri, 24 Jun 2022 13:37:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 452378E0245; Fri, 24 Jun 2022 13:37:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0EEDD8E020E for ; Fri, 24 Jun 2022 13:37:20 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 91D91120A48 for ; Fri, 24 Jun 2022 17:37:17 +0000 (UTC) X-FDA: 79613835714.11.4780C54 Received: from mail-vk1-f202.google.com (mail-vk1-f202.google.com [209.85.221.202]) by imf03.hostedemail.com (Postfix) with ESMTP id 4E5282001C for ; Fri, 24 Jun 2022 17:37:17 +0000 (UTC) Received: by mail-vk1-f202.google.com with SMTP id t191-20020a1f78c8000000b0036c28bfe148so923181vkc.6 for ; Fri, 24 Jun 2022 10:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=a/I3oVqLRkRj5HBns0MWW3Ig4smTJMVIYbM6WBPe2Ok=; b=Oi4b3uHib9QeDIaeFbYIYjHKGKKHh9PJftREg1F7x7dC3MdxzlFlkF4nFN2oUkEmJv ksO18/0H6IRArOgx9eqn0gBPvHv2o9/dMee0FdF4JnH+jRgLOM2Nmsz6Dpy3izb1wBXI nx/vriW2gKgSHU0JVyGwH1vUXSXmgF4EHLnj5axRDix5D/a9yC/E9keoj2kNivTofhb4 42LtC0DSUfNjTGTr1svMT6wtFWhev3hUy0WltrufYZ9eblHJrOi+VTLQFp5FE3ILODHz B23csyok2qwTFatLcA+FGCv8SsDhrPMlNnuTVoNybqfkwHtiNOSZnpNZ1wSXRcUNFGXT kHFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=a/I3oVqLRkRj5HBns0MWW3Ig4smTJMVIYbM6WBPe2Ok=; b=4AhT3/iCBEcD3+eiaz08LOyy5PefHLa21sP1+YoeIsTG3/FOmLPU/YpwUrUud5iul7 CkLqvcLUQZvOZFTLRLDbFuUo0VOwHh5/w1+fQKJTphGLiX/xT2I/Jg8QZu1h0HE6EoLe 8JQn4G4BEdxm4y3WdYw7fDkjK7wKdRyFgTctCHYAzbT5zaKSxxauIZ7UHc4GiGe6q8Qs amA7+7zIdPr3bL1d+Bvi4LXOLCdEW6n6ll8qU0aGQjYfzyjmkFxHmDZ26pqQoKz0yvD3 6ZYDP0CFIs3ou3lkwH7q04r0ca3VXeCpvs6CjzSRb1H94XmgOTMib/L99db7m86zHFTI /xLw== X-Gm-Message-State: AJIora9I/ow4+plmNP/IvDxwibydd7AvFr1IBqqub6bUOCNw0bxJvQTF O/AA9Z/hHP8VAnD38I3LQHDhHhq94IQiNt0N X-Google-Smtp-Source: AGRyM1ulcuwzT9arHdsQPyjRKEdIRoxwLhneCD7SBt/oCPOlZSq/mYJ1bqnOaa+5zikkIexlm8WeaXwx6yxitdUI X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a1f:2657:0:b0:36c:d88e:88cc with SMTP id m84-20020a1f2657000000b0036cd88e88ccmr256693vkm.36.1656092236628; Fri, 24 Jun 2022 10:37:16 -0700 (PDT) Date: Fri, 24 Jun 2022 17:36:35 +0000 In-Reply-To: <20220624173656.2033256-1-jthoughton@google.com> Message-Id: <20220624173656.2033256-6-jthoughton@google.com> Mime-Version: 1.0 References: <20220624173656.2033256-1-jthoughton@google.com> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog Subject: [RFC PATCH 05/26] 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 , Jue Wang , Manish Mishra , "Dr . David Alan Gilbert" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Oi4b3uHi; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of 3TPa1YgoKCC0ScQXdPQcXWPXXPUN.LXVURWdg-VVTeJLT.XaP@flex--jthoughton.bounces.google.com designates 209.85.221.202 as permitted sender) smtp.mailfrom=3TPa1YgoKCC0ScQXdPQcXWPXXPUN.LXVURWdg-VVTeJLT.XaP@flex--jthoughton.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656092237; 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=a/I3oVqLRkRj5HBns0MWW3Ig4smTJMVIYbM6WBPe2Ok=; b=2Cdwt7sDa6Ry0p0+BfZzhfPHwOZ1iB45xrnmj/RXzECIXhNepFmCno/vHoqgsPq83wNnkH wq5yCl9BPZ0vgRxPKc5kB+MytcrDdfUDX7JG+kbQ5ZKFD5eiwUtbarcbXQFCyJHakZ7ECM djCYrIPhqfd49XW37xb0KOTkTvwrstA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656092237; a=rsa-sha256; cv=none; b=FEbgkbv/ZfXGrz4JiylUiEKPQKemLZyey2+0FLqNarkbPR+5Zb9I6BnACpGIeAC5KB6frG JSBeldfG1IQcJKLkT2pxVovng7UhB8hlp+XWUSxwNEJfgmiJqQarpXH8W3vvR7RyYra7gL Omx8Yqp+GFDoFaqPkfQC4t4XT7IRWRU= X-Stat-Signature: 6apoknntit4xxg31iio3i793znp5rqoq X-Rspamd-Queue-Id: 4E5282001C X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Oi4b3uHi; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of 3TPa1YgoKCC0ScQXdPQcXWPXXPUN.LXVURWdg-VVTeJLT.XaP@flex--jthoughton.bounces.google.com designates 209.85.221.202 as permitted sender) smtp.mailfrom=3TPa1YgoKCC0ScQXdPQcXWPXXPUN.LXVURWdg-VVTeJLT.XaP@flex--jthoughton.bounces.google.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656092237-887624 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: This adds the Kconfig to enable or disable high-granularity mapping. It is enabled by default for architectures that use ARCH_WANT_GENERAL_HUGETLB. There is also an arch-specific config ARCH_HAS_SPECIAL_HUGETLB_HGM which controls whether or not the architecture has been updated to support HGM if it doesn't use general HugeTLB. Signed-off-by: James Houghton reviewed-by:manish.mishra@nutanix.com Reviewed-by: Mina Almasry --- fs/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/Kconfig b/fs/Kconfig index 5976eb33535f..d76c7d812656 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -268,6 +268,13 @@ config HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON to enable optimizing vmemmap pages of HugeTLB by default. It can then be disabled on the command line via hugetlb_free_vmemmap=off. +config ARCH_HAS_SPECIAL_HUGETLB_HGM + bool + +config HUGETLB_HIGH_GRANULARITY_MAPPING + def_bool ARCH_WANT_GENERAL_HUGETLB || ARCH_HAS_SPECIAL_HUGETLB_HGM + depends on HUGETLB_PAGE + config MEMFD_CREATE def_bool TMPFS || HUGETLBFS