From patchwork Wed Mar 27 15:23:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13606782 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 43B79C54E67 for ; Wed, 27 Mar 2024 15:23:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BFF216B008A; Wed, 27 Mar 2024 11:23:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B83386B0093; Wed, 27 Mar 2024 11:23:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C9DB6B0092; Wed, 27 Mar 2024 11:23:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 7E5156B0082 for ; Wed, 27 Mar 2024 11:23:46 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4DA63806A5 for ; Wed, 27 Mar 2024 15:23:46 +0000 (UTC) X-FDA: 81943188852.02.0C2621A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 171341C0026 for ; Wed, 27 Mar 2024 15:23:43 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UN1YbEx6; spf=pass (imf20.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711553024; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bzTkuuEUZ2f7C9YouF2ORWZwnTLSeJ8Y5AJhy7kkISQ=; b=fiOZPYWie5WMZmm3Uy+uHjw5nbmkGdLsHp+Bq9XqGvF+bGEFq9Wli5WIaAwZOxd8myIUMq npHD1jXu4n8sWaHjfqshyiv0BVvjre/3G62I7DXkFPl6r7fHLykYaiJQYK/aATsu3JbjIa ix+ts+W7CGH7ns9jbAApiuYLgMy9a0Y= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UN1YbEx6; spf=pass (imf20.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711553024; a=rsa-sha256; cv=none; b=68+5twMAcOTlUexmr6jWNLOU61rGAl+QF7lvz9KRojGJn3KWIr+XKFWTUBa/LOPwHLL7D5 QUBnFnKuHRteMbFqeIvsZC5LdC5kO6/hQz2XKRXVps8mD4qmdP4M19/U40jF/mqnwvod0d gRi6l1AWsvukb//b/H0zw5yZqsUa6eM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711553023; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bzTkuuEUZ2f7C9YouF2ORWZwnTLSeJ8Y5AJhy7kkISQ=; b=UN1YbEx6Jsm/AzvLT6ULyL6dHufIChZamumgV5TgOi3E7CFJpZmdhS4Tsp0W3H/C++mKGZ SoJx2cfZMfAWdNzcZytDi1MH4dsW7ZIbRoXEU4RtrDM3LPgYspfLx9osrxTRqoWFBRlTAQ SjlcSCr1A3uwU6lpq1BwEvUkweRbe3Q= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-28-hx4n8dwsNg6mkoOV4Y4FvQ-1; Wed, 27 Mar 2024 11:23:39 -0400 X-MC-Unique: hx4n8dwsNg6mkoOV4Y4FvQ-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-696a9c482a4so3595506d6.0 for ; Wed, 27 Mar 2024 08:23:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711553018; x=1712157818; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bzTkuuEUZ2f7C9YouF2ORWZwnTLSeJ8Y5AJhy7kkISQ=; b=AjqA5TgEHK/8TalTIfmaoHBy6hk4wcZUiiFEUDueR1/t3KHsxILFtKQgu2V1zElVu3 lJAjCe2HYq59JiLdBjo9QJnrK1PdQcKX9PmhZQMPuJahYiHdVrulprjQHGRbcf9/V3Hk Ql9J+rDb5jnLAPY5S90upeSxS51js+ZcYzgJt6JSp/w4J/ETo0iKz2p6doUyH8zkqFXd ztV9HVuYUKS5Z1PJoMqzwDQeIWLEj6syBugQMsN2FMLotin30g06Vwmfc8iwNKn/Ti9d 2/bADi3UBrFcJXTRAB+wB7QoMF6xUuEQ7yaz4F+QCttBp7CogpsVLbbuXrGSmHU3MnXK 4evw== X-Gm-Message-State: AOJu0Yxq6iPEWAiPqhwehccTt94pDYSpKZBoVGzuFMu4DtiQkL0RUPAr QieCbw4NzrU7954RkG6g7rTxJytFpt3/loSmBbMyVe3jt2GY63pXHFz9+m99Jke3HXCL6uAFhwA YDtc6rUwz4mGjFY6J2GAb4yX0EgLcwpDmKEkVXrMzUPfKPPurX+PSmTte7YSpUm/r8bTCtJ1eKK 9W928ISG+TssTSPN1/5CsvxcpKRePPDQ== X-Received: by 2002:a05:6214:5d11:b0:690:3c85:c5b with SMTP id me17-20020a0562145d1100b006903c850c5bmr14918747qvb.3.1711553017836; Wed, 27 Mar 2024 08:23:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFplzIHsd2VycAjj5oUNWAa5qW9RFPqJwKtRaT5aqzv2S9fkhcwA1AKc/2h1PXS7yh/3x/6aw== X-Received: by 2002:a05:6214:5d11:b0:690:3c85:c5b with SMTP id me17-20020a0562145d1100b006903c850c5bmr14918682qvb.3.1711553016992; Wed, 27 Mar 2024 08:23:36 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id hu4-20020a056214234400b00690dd47a41csm6412639qvb.86.2024.03.27.08.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 08:23:36 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Yang Shi , "Kirill A . Shutemov" , Mike Kravetz , John Hubbard , Michael Ellerman , peterx@redhat.com, Andrew Jones , Muchun Song , linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Christophe Leroy , Andrew Morton , Christoph Hellwig , Lorenzo Stoakes , Matthew Wilcox , Rik van Riel , linux-arm-kernel@lists.infradead.org, Andrea Arcangeli , David Hildenbrand , "Aneesh Kumar K . V" , Vlastimil Babka , James Houghton , Jason Gunthorpe , Mike Rapoport , Axel Rasmussen Subject: [PATCH v4 01/13] mm/Kconfig: CONFIG_PGTABLE_HAS_HUGE_LEAVES Date: Wed, 27 Mar 2024 11:23:20 -0400 Message-ID: <20240327152332.950956-2-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240327152332.950956-1-peterx@redhat.com> References: <20240327152332.950956-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Queue-Id: 171341C0026 X-Rspam-User: X-Stat-Signature: f9mzahnpbdwwuseqizndppdfnj3w51nb X-Rspamd-Server: rspam01 X-HE-Tag: 1711553023-944894 X-HE-Meta: U2FsdGVkX18aNLFef+fdUpQ1ihvPLcPB434YC1OWVJdnow8VukYDvN9Lj8BNqHgNWL/9PJVOUx7VW5acHwZDvbyJs5QG07nclOqpIbU+3cRy+oa4ROH2GO4IpV48QawIeh6KkafC/FFU40XTaPrfTrIeOMhJh1q2DZBiPbvW0UYMWO61ip0vujqProxwu/h+p4Q3JvF/IOZu50/2RJEF6168W0asrbhNHHb8feS1MQ0URGedXjTE/sFJWCjoVMtry28in/lpZJ1aryFtFfDAwoKJymbltNEJcgHDvwPCte6r+Thv3x1hTO64heRDLlhie5pzMA/qp8jemVpcvM4GFERYAFTLPbwM1VLPamuS/sbFOq5BZ1wtjS5ME48qdcnuJZlab8rZk5hIOJsvQOQHKRWK1HNxP5e1HMSU5InCH3WRbamFqIX4qXPREVswJoKd7oYLVFfE4ZAYu3mrmP166hpqxKXEPaduIU9UsvZjgSy9sUAH/bqzIdgekOkG1RsJq9pIaPJD6EWW3bGuypbnCvPQHTd0fJB5CqLFn2+eH1+UJ11sLCZss4RF+FnK99KYwDtwYhnaJ1V6s6pnDdjRJ+6F20bpH6N4PzFFdhQYwjBZk0wp0xB2lM/3mlmhN46CQiQGHPpLekpd362PkNCOz3HpjuytFt094yoaqU5weKkYk8dul57vLe9X1/MxrLKorCChhLHBauiLR66V/h7rX+sXdaIMa/JhlvmMAqNmUa4nqKVe/NeG1ktattilIQtQsOzLP1DlmhLNNOizdcOIN/K5CgHqU4mzprZWyxsX9HmBef9BrREyowsOfsFi63Z5t827eADs2ZO0rAMQRBRDfqQ1p4kakfh3TSuMAN9RIqzU2HM4GSneHM/9BKnq4WfhTCJ4JRBueXIn8JcF8zG1Jvy/8EyXHTpVZNu8hhEfZOYMnuczj54pejEwd+jv6xfXD4gMYb3lg+XIryNuUJP kFJFpr/H PTsUW6DQd2wBX6VJATYrqvJcUDUvRCOOsBpM5gH9REtRBcn0WKe0B99OeMpM8TRM19cIfM49GzN6sTToZc4RBrjGoAAfQ6eztUjpKKfCaY9AARlfehzRy7XlarTg73rRcmdzWDfqYk2gEeztnctNwpa6ZXH8Yb37pdA1prWVIsK8jVXRWVOuyv6JsUxjF2G3jQ3nrX94/5cAGIZnZx5761UjEAXX2nVB1nQy936NJKY+jJG1LceKYIcLN5zKS6hs8i0BygQmsmGpgW/MOKa7LxDzqK7cvBqkV9Jph0lBwH/8XwT1+puvkhfvRDTDDXhu9bV0FiBKgkKsLqiEaAGtTpVWoYPLXp++L9CKY5P1cE+3KMtk1evadjsaAan/C31wbwy7HlFBgw4Rn19akhO3ulki2/wE/EKecgSh8BAOVVeO1lvEnJ11OTcvAVh8MWMLUEGX0mJqpZ3o7ep8= 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: List-Subscribe: List-Unsubscribe: From: Peter Xu Introduce a config option that will be selected as long as huge leaves are involved in pgtable (thp or hugetlbfs). It would be useful to mark any code with this new config that can process either hugetlb or thp pages in any level that is higher than pte level. Reviewed-by: Jason Gunthorpe Signed-off-by: Peter Xu --- mm/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index b924f4a5a3ef..497cdf4d8ebf 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -850,6 +850,12 @@ config READ_ONLY_THP_FOR_FS endif # TRANSPARENT_HUGEPAGE +# +# The architecture supports pgtable leaves that is larger than PAGE_SIZE +# +config PGTABLE_HAS_HUGE_LEAVES + def_bool TRANSPARENT_HUGEPAGE || HUGETLB_PAGE + # # UP and nommu archs use km based percpu allocator #