From patchwork Tue Dec 19 07:55:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 180800 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1778217dyi; Mon, 18 Dec 2023 23:56:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKzPiHeUymRPDtsP8/KmP5egOhFc6ZFEh8GZGfE9xnCGsLPwX6VLRJHismCw+wMNeWnyUt X-Received: by 2002:a05:622a:1708:b0:41e:1d15:69a6 with SMTP id h8-20020a05622a170800b0041e1d1569a6mr27240967qtk.31.1702972592628; Mon, 18 Dec 2023 23:56:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702972592; cv=none; d=google.com; s=arc-20160816; b=s7ckSs7asXUdyi4rcuVc7+VOMF/Lu9+TY1trMjCGRnvm2bIa9ZHRff961JPPA1dL2R 4R5FSJDZhk2K/ZnR1wLLwLOno4IB8rusF4Eg6O//zwk82bpi9aJ/hKNaOJf+KIP+IyKi JZJEIPfmBVnoUD5aRkTFR3wm1ri6th7/kqsmODO3Ec/NSK+7yiB17tbti62wJWFMUC7w PgikUfJDKpMdCKazbWQu0gbzu/4Kvl89wgTGeAUt2KHOMVF9xJgXC9ueIzl0sqLNbcFx /6RAt3cAiHXkBcXM02hRppQrq0finJwnj5aFTzSZa+2VHccpOUV7LO9whLbKTbeaGu+r 9Aqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NRvgvssN6KVSq9rYZ03PlMu3BaOgDfLGQsqd5RQuPrM=; fh=3mpu6Yyr5hMzDKtkQvzcApl7ZSQGU4G8QyIY2BAU7VY=; b=ZEfuuVzHjNwkS80U8WUvU+O5Btk8gYuepoGwsIQQvoyysHx8SNfjJAaQdSdpql6CCR D0CzWovXiL2VNzhKXxDY0TYOGT04Ui76YsQPfuj9Db/sAOxHhdNsxpAWfF1w6jCux21R x4TNPQkMk3T2swgDuSnjGIRdmfquzmudjg2T5kB6fO3TQd4uc/2FVAOkarO/OwzSOdMX XCYTKLqJHi94vn/ly3pj9J9gBVPTg2wWvjXsdLzJkUU3hiaK6LIJozIywFEYUYfUlFmG O515KU3ntnCaMmPk5eY8P79sxcBfGSB8S9IdROkjaVEWe/zqXNTMklkmyOPMHbQAUwWY X1yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KTl2MQc1; spf=pass (google.com: domain of linux-kernel+bounces-4834-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4834-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bs24-20020ac86f18000000b0042378c526a8si27942531qtb.569.2023.12.18.23.56.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 23:56:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4834-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KTl2MQc1; spf=pass (google.com: domain of linux-kernel+bounces-4834-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4834-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 62A5C1C2372C for ; Tue, 19 Dec 2023 07:56:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53032134D2; Tue, 19 Dec 2023 07:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KTl2MQc1" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21A9B12B60 for ; Tue, 19 Dec 2023 07:56:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702972570; 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=NRvgvssN6KVSq9rYZ03PlMu3BaOgDfLGQsqd5RQuPrM=; b=KTl2MQc1qjJSDnZ+ZNXtzsi8B2d2fzd/vgol6a3tXXDBnugvGpmgFArhd90xNSXoIIpDla Xa7615j8a7XEUY+WVcK8hFx9KnVjgVhoLAV9AISiMw75yBjQZ3yDzIbuZHh2TnJMwR4vVe biMb1DGFi9jor0dpqrp6Aj+Gs+/xi0g= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-dipUc7OWPBCmQTMSma-p8A-1; Tue, 19 Dec 2023 02:56:06 -0500 X-MC-Unique: dipUc7OWPBCmQTMSma-p8A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 E23A729AA38D; Tue, 19 Dec 2023 07:56:04 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4B6D2026D66; Tue, 19 Dec 2023 07:55:52 +0000 (UTC) From: peterx@redhat.com To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Matthew Wilcox , Christophe Leroy , Lorenzo Stoakes , David Hildenbrand , Vlastimil Babka , Mike Kravetz , Mike Rapoport , Christoph Hellwig , John Hubbard , Andrew Jones , linux-arm-kernel@lists.infradead.org, Michael Ellerman , "Kirill A . Shutemov" , linuxppc-dev@lists.ozlabs.org, Rik van Riel , linux-riscv@lists.infradead.org, Yang Shi , James Houghton , "Aneesh Kumar K . V" , Andrew Morton , Jason Gunthorpe , Andrea Arcangeli , peterx@redhat.com, Axel Rasmussen Subject: [PATCH 01/13] mm/Kconfig: CONFIG_PGTABLE_HAS_HUGE_LEAVES Date: Tue, 19 Dec 2023 15:55:26 +0800 Message-ID: <20231219075538.414708-2-peterx@redhat.com> In-Reply-To: <20231219075538.414708-1-peterx@redhat.com> References: <20231219075538.414708-1-peterx@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785696188976149927 X-GMAIL-MSGID: 1785696188976149927 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 --- mm/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 8f8b02e9c136..4ca97d959323 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 #