From patchwork Fri Aug 2 15:55:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13751718 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 22794C52D6F for ; Fri, 2 Aug 2024 15:55:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7EB26B0085; Fri, 2 Aug 2024 11:55:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A064F6B0088; Fri, 2 Aug 2024 11:55:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8CE286B0089; Fri, 2 Aug 2024 11:55:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 63A856B0085 for ; Fri, 2 Aug 2024 11:55:49 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0E8C3A7DA0 for ; Fri, 2 Aug 2024 15:55:49 +0000 (UTC) X-FDA: 82407756018.23.ADBEB2B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf11.hostedemail.com (Postfix) with ESMTP id 552E640025 for ; Fri, 2 Aug 2024 15:55:47 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Hy97X8ye; spf=pass (imf11.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@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=1722614070; 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=UBGeX8yYPmEXT+9EKnjIl4n92Yc2dlnMkDo/CXaQu2Y=; b=YQcMAZo+n19Ri30TsTmDOcgPi2LCuiEE2bMyc6gBDR5lSA0Ii2V0iVe2FGAaVoJ3xRbjVK NCXXwrR8RnubrvdtFxKXPFy1OBXnC1SYP466+YqJixKBk3Q3Rq4duPyu3Bv17sVb3802/A 4q5p2YKZGnhuT0XKzyZiS4FWFwbsYug= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Hy97X8ye; spf=pass (imf11.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722614070; a=rsa-sha256; cv=none; b=j6voN8KTSu3FqTFc8YaY74B4o7zmgAZ1ynBZ3jqXyALBPYizY+3Uc1hpV9gBxRSD5zRp2y db513A6V6ppakGRoP6WczxMqbvkb2FBCuB423Tdy84faOhgH04A7ib5OmzCTzxALhiLxat 7gbY/lkZBBip730L5D6DX9FCNS+dHc0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722614146; 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=UBGeX8yYPmEXT+9EKnjIl4n92Yc2dlnMkDo/CXaQu2Y=; b=Hy97X8yew4bmD2W1uY8Xv85CeEbi/x92a2crHxmsB2R9p3pQzSdesWpv6xqE+9+syQOD7Q CnT8kld4YPKO4/ukDdfjmGh3VOQymlHKQdgGYRgCQ23DKtCb3QQ5JeBN7U7zN7XJ1LkpVk A2uY250xAR6EdT6G/yVMuiad2NT70fs= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-3V3FyyZyMi6_6IaMXo6ocw-1; Fri, 02 Aug 2024 11:55:42 -0400 X-MC-Unique: 3V3FyyZyMi6_6IaMXo6ocw-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D08A81955EB7; Fri, 2 Aug 2024 15:55:39 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.192.113]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 90DD4300018D; Fri, 2 Aug 2024 15:55:33 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, David Hildenbrand , Andrew Morton , "Matthew Wilcox (Oracle)" , Jonathan Corbet , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sven Schnelle , Gerald Schaefer Subject: [PATCH v1 01/11] mm: provide vm_normal_(page|folio)_pmd() with CONFIG_PGTABLE_HAS_HUGE_LEAVES Date: Fri, 2 Aug 2024 17:55:14 +0200 Message-ID: <20240802155524.517137-2-david@redhat.com> In-Reply-To: <20240802155524.517137-1-david@redhat.com> References: <20240802155524.517137-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 552E640025 X-Stat-Signature: fbpwatsjj9m911ggjf46fyjiomemw51j X-Rspam-User: X-HE-Tag: 1722614147-447601 X-HE-Meta: U2FsdGVkX1/oHAlDxY5o+Yu9OKoYvlhPXrNkWqaxENoYrCzXCO4iR8tcv97KiJKoqueAeoxE+xSyneKPWsRPsMKzAWvzFZ7yVnxoTCzujQkdFRwC2+l7Wk+QWXpQLmaKn04kD+XPMKJB+hc4i1hgaB0Z4rWI13H0a9UiLar6oih7yUUUhzpfVQQHGXdzI+gofVSNqLD9iQdndh0pzr9iFa9nsIfJqoC+eh4+UtYo0cKIKeZqxdJWn1FncgXCVLXalUWpYqS0kBk/H2Ca07s0Lu0B5Gn/eo8J2Amrid1oHnkQ7K0nejVp815k6RPNl14HkKFYTxv/p4jzg4hjXhJBcyr7L5K+FIyU+tVcCQiD2WPMwlWhjqhB2f1n1XHC/BLte4knzRbkMAsPbJsAGVCg4qZeYo2Ap6xLInbLPvuTgHrPoR/1YN4KLtdxHMwC0LvCU6YV2Pg2g7PlKHs0TlT0ofN0iZiXKQ2AxlzH0Q58ULRXApRKmenE07ozdjL8D6AVY5Q2OcqqSeSq/3AAVbOTQKI2TUZHmcnj8cxVMDEI6ORyZT+lIcdZvcCPzHyFGLHIHvq13dbRKjEcPVemqb/BhINnJV2PDXi4ToKWqOI4pBYTRnNf9N1M2lVCeVCxvncnVmmrtc+9Bc9U48/qtT2xzwTru122b88fvSUuIYRWcI69HnqZ3zPT34nzFg9gJubq8eaNdHmQIDgLvCV4s2f7CTCMPpssq2iw/UANwTW/FJfZIynjbRxwYUZ9YPIYSuPiV/ka369odaftvqFzDwSqK/nljPhfXoKGhP3AXzV6yAG0RKOosUFX6aeYZoprmFy98JIzNfBoYMyFrJWmeKVF+cQT9ZocO/HmTtoKrFh4HYIqBZmUlTay1yY5poK8ixsoFEQgQNXDZlDm6H55DhQLpHtfKmlVIXUQjYGAKFk+TFMjIKvqm3iXTLn5QTZWbOesteyVJW3K3cSFrKMKiIL g164gdHD mKU2mlIVBHea1av38lHoEahx5kQbb6JJCYNjdOcjaeMa8K82LnI/Im8Z2eXvvlF2AGhBhL5qa2ljchp8oeVAG5kpwx2B5UTDvT5Ay19o8GEKLeYtEuPN2fkr1g68U+OIJ2APsQT9ecG5n2yYm0+APEe0TQ3/1q5hFEYcIlWN9y3kmfCkp+6NnB+RpR09d1MqusyBEvaWG9vsu71cNfXl+tj8mEFY1e/Th57MVgaXIRoTnXBI7otw0A+qd9wBQD+LdhOa+69qflPCuQxbmy9nYqPQa6IW6pYwRok8impm+1plJC+FDdLkioXHs4FxadF9SdPvlK3zSAXP0aQIws7LcCvOQAA== 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: We want to make use of vm_normal_page_pmd() in generic page table walking code where we might walk hugetlb folios that are mapped by PMDs even without CONFIG_TRANSPARENT_HUGEPAGE. So let's expose vm_normal_page_pmd() + vm_normal_folio_pmd() with CONFIG_PGTABLE_HAS_HUGE_LEAVES. Signed-off-by: David Hildenbrand --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index 4c8716cb306c..29772beb3275 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -666,7 +666,7 @@ struct folio *vm_normal_folio(struct vm_area_struct *vma, unsigned long addr, return NULL; } -#ifdef CONFIG_TRANSPARENT_HUGEPAGE +#ifdef CONFIG_PGTABLE_HAS_HUGE_LEAVES struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t pmd) {