From patchwork Wed Jan 3 09:14:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13509764 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 853CEC3DA6E for ; Wed, 3 Jan 2024 09:14:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0DBCE8D004F; Wed, 3 Jan 2024 04:14:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 08C088D0035; Wed, 3 Jan 2024 04:14:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E96AC8D004F; Wed, 3 Jan 2024 04:14:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id DB7A28D0035 for ; Wed, 3 Jan 2024 04:14:58 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AA49A160265 for ; Wed, 3 Jan 2024 09:14:58 +0000 (UTC) X-FDA: 81637440276.10.795272E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf12.hostedemail.com (Postfix) with ESMTP id ED55D40002 for ; Wed, 3 Jan 2024 09:14:56 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=V9EpdFsl; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704273297; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YJJA5xKvoSxf1aIwLnbJbk4H1JjSjqj4D+JMLQtFT+4=; b=WdSJAJBEOIDI2c9EJZWOBFZysIXdPu1b8CQwFDUc8xcseEOgeWcqHAiYNrDfYjP2mDkDQA 3LO8r1Gyc+UbsWxgMWxfFM9kEOHv5Nbj01zz/Y4GfC7CWlx78NukXiR2/r7MUYeF+k2HMc +xa/Y+mN4yksuqgtMQAjHlhP1zpuqF4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=V9EpdFsl; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704273297; a=rsa-sha256; cv=none; b=wl9u7PiiMpRdIXc90r11+g93Y1iFtQOYQCatzfDMWXsPa2FCpMMdE9CYmLWX3IiViJwr42 V6mASLLsXuTGdxchDXHifBjJTzQWrj3ILAnKODQGPlPhWN4lfZ+bAWfMecFqZNuqWEgO/3 oHbhnt4fZ6mH4JV5RSFhqls+wVy6Tjo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704273296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YJJA5xKvoSxf1aIwLnbJbk4H1JjSjqj4D+JMLQtFT+4=; b=V9EpdFslxRIH2/lLW4yB2vVju2Wmw6ulwmw7navuSF732JvWfyJofY0ILaeqeayV7bEpau 4xyTZl+t9eaICVM+XXC3nn4twTx3ZuqPzhVdLOZKUWgF2ixP2jrxGJoJY1j03LNGGowFhS m5axgNfWhAhv60Hw7EsH72rk16WeIfM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-173-O3owD6t5PRKmlxLnlxARAQ-1; Wed, 03 Jan 2024 04:14:53 -0500 X-MC-Unique: O3owD6t5PRKmlxLnlxARAQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7E9B87DC02; Wed, 3 Jan 2024 09:14:51 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40971492BE6; Wed, 3 Jan 2024 09:14:39 +0000 (UTC) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: James Houghton , David Hildenbrand , "Kirill A . Shutemov" , Yang Shi , peterx@redhat.com, linux-riscv@lists.infradead.org, Andrew Morton , "Aneesh Kumar K . V" , Rik van Riel , Andrea Arcangeli , Axel Rasmussen , Mike Rapoport , John Hubbard , Vlastimil Babka , Michael Ellerman , Christophe Leroy , Andrew Jones , linuxppc-dev@lists.ozlabs.org, Mike Kravetz , Muchun Song , linux-arm-kernel@lists.infradead.org, Jason Gunthorpe , Christoph Hellwig , Lorenzo Stoakes , Matthew Wilcox Subject: [PATCH v2 01/13] mm/Kconfig: CONFIG_PGTABLE_HAS_HUGE_LEAVES Date: Wed, 3 Jan 2024 17:14:11 +0800 Message-ID: <20240103091423.400294-2-peterx@redhat.com> In-Reply-To: <20240103091423.400294-1-peterx@redhat.com> References: <20240103091423.400294-1-peterx@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: ED55D40002 X-Stat-Signature: f7towx7qyoowio7uyi3nh8qta1km93ey X-HE-Tag: 1704273296-678128 X-HE-Meta: U2FsdGVkX1+YXIpgW2O+tVm1XWuzkRvyjlPAT0g0eLF9KdZYUxYFcr4mvirFGo6hlaFU/g+SxNdXTOTsSscysqF4fyhZB55h9hcQA1Bj3za/V8UubKCo4EzKRbYzvFnwYMwOpeoyBwZ7KqDcU5h9Y3DWykyioaBtIgSFrU4OKlB5E2EMUBFZ7f4E5DpHRGYAyqkyWm9joWUBtmatNsrsttQz93YLXzxNeuVM1KwS2N54NfLntkVA5pj9RvU5ZnxHzqXFWHhDjRAJpAKHv7OvVTqP67JaMSSlCkoidBUjBbCm38JPSAXf42mMEBj/PyoMhkHcssU77JlM9oJHvuOlyozj/KQrNjz11QIexIrsJFLunNrUSbn0ictOuiURRv1JQnxzT0B+cLLpfW1a6Gf45mwsskVvb4UbT8VPWXdul5eSYmNJuI73HzpHakmin7NlweTTQwb0pYRPm4hrEMwg0qbULFvWGUPNZ4T6Yqf9bm2ewkrn/hFXVKl5eheHGtoeh064FE+vb10Y3KeVBaoaexAzqC/cJxYbT0DvT75jnLxq3/Be0whOUm3jgfPE3MS8BZpYiYTlYRIdTOigBXZTcN+kD1sRfwOkZBa2PDh6PP2IpUQwtfJW9XMk8oUjJfiZN5t0qRCpx5OFaa01pYuERVXarIVJ3lHYwZu5zCfZYK6ryu3tP5uvAF4IzXJ1s6IrVcOtIpbL82mKAWlKgJj8LkNWaAL5LeHupb3X/UKZlLX8Sit4mCWUzOQzuuxz2BesL+x2kHgAKzgETcUAKnQt/I0+yG1J1k6sz0vCfidm2Iu429JkV7K5MQopLB/r9YRwrHQwrVcWFOddgV5cLHk3nR4O0Hs4FOiZncPg+WBPPe+C/tezKDNclEYLI6+hbaZYr8jlBRHRkgcnwrTJu5rNIQbboL/srbmbegC7e2Ps5N/ggG2AXsD44OoxDDLOUac99AmfOjMlWWpEyxmcXaj hssMBV2o xHO/Y7Orc59NyjZhtoAKjsrONfIuUzAgl+gRj2r0G5dSaEvqpOGQtSUfsVFKqX6WVL4k9sfssy5h6kebaXp2Zpt9NbgQL1+Bn8wVIPOwprVk6OYPw2vIBUl/MwqDttFbV6TwBCUgRdKR0um5eSUAlxZTyTdvxn9/IHV0VPJSPU0NNWnqelVZafpsjwtdXbkZFqGXZN1NdsAYQkx8iDSU5ZjiVtg== 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. Signed-off-by: Peter Xu Reviewed-by: Jason Gunthorpe --- mm/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index cb9d470f0bf7..9350ba180d52 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -904,6 +904,9 @@ config READ_ONLY_THP_FOR_FS endif # TRANSPARENT_HUGEPAGE +config PGTABLE_HAS_HUGE_LEAVES + def_bool TRANSPARENT_HUGEPAGE || HUGETLB_PAGE + # # UP and nommu archs use km based percpu allocator #