From nobody Fri Dec 19 20:14:21 2025 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 0474732C95D for ; Mon, 15 Dec 2025 21:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765833440; cv=none; b=GWzP6pG6nRx/xiT3rKJ0o/LLVaEjXRtMaDe8jSYwsYTrMKYzJr5tK2FTIUB7G+MVIO8YoKdGv2AUuWfVR6heZ0D2LzrbkqvPlXLuDmlKsYb/NiFWFxK2CPbRoCywBJDXPlmHv/Z5uflSLq54yIyUDVnTt7u0FFPE6OYnrxSRpEc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765833440; c=relaxed/simple; bh=jVILyFQWGEfVpTFUewSzYViMD3BcNCje/XpVFEFVaqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IKX7tPxw9ccdgPCPCelMAZGQ0luHNiBuJtpq+80SmZ0bDGDu1t5YBGxtg4pjpY/AQQ/YhnYVUSbUbAd1LrIHP3beLepJ2EFTaR+lJO40q+vsezTZ4+tpF+nlZG9h/lZgb1ovmV7y2ZmsvgEefHcZSQDdWRou+PwIt2fQuHmWqD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Lp+tOfS3; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Lp+tOfS3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765833437; 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=Ait6SZZngNXoHHnOqheyBbMc11rfYo1TPeFRuknnOOY=; b=Lp+tOfS3ZdFmI6Bwf963vx8O0pVe6haP7ZIMApFlqsMvgrBG6ZonsreWe9PzDvbVn1mWoq uVM0X41RVEAOKtNK8qVY4BrEOPTm+5zh+XpeWNcqCRvoL7Nyhlxl+tHC8sWYcJ1BUCEoiL cbegksJ4lAODOVcULm84EbnfA7Yomf8= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-520-nzzYKGg9MMiqcgReJcMjCw-1; Mon, 15 Dec 2025 16:17:16 -0500 X-MC-Unique: nzzYKGg9MMiqcgReJcMjCw-1 X-Mimecast-MFC-AGG-ID: nzzYKGg9MMiqcgReJcMjCw_1765833435 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3906D180035A; Mon, 15 Dec 2025 21:17:15 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.80.180]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3C4DC1955F21; Mon, 15 Dec 2025 21:17:14 +0000 (UTC) From: Luiz Capitulino To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, david@kernel.org Cc: ryan.roberts@arm.com, akpm@linux-foundation.org, lorenzo.stoakes@oracle.com Subject: [PATCH 07/11] mm: shmem: use pgtable_has_pmd_leaves() Date: Mon, 15 Dec 2025 16:16:49 -0500 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" Shmem uses has_transparent_hugepage() to check if PMD-sized pages are supported, use pgtable_has_pmd_leaves() instead. Signed-off-by: Luiz Capitulino --- mm/shmem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index b329b5302c48..ad5825667b49 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -689,7 +689,8 @@ static int shmem_parse_huge(const char *str) else return -EINVAL; =20 - if (!has_transparent_hugepage() && + if (!(IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && + pgtable_has_pmd_leaves()) && huge !=3D SHMEM_HUGE_NEVER && huge !=3D SHMEM_HUGE_DENY) return -EINVAL; =20 @@ -4655,7 +4656,7 @@ static int shmem_parse_one(struct fs_context *fc, str= uct fs_parameter *param) ctx->huge =3D result.uint_32; if (ctx->huge !=3D SHMEM_HUGE_NEVER && !(IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && - has_transparent_hugepage())) + pgtable_has_pmd_leaves())) goto unsupported_parameter; ctx->seen |=3D SHMEM_SEEN_HUGE; break; @@ -5439,7 +5440,7 @@ void __init shmem_init(void) #endif =20 #ifdef CONFIG_TRANSPARENT_HUGEPAGE - if (has_transparent_hugepage() && shmem_huge > SHMEM_HUGE_DENY) + if (pgtable_has_pmd_leaves() && shmem_huge > SHMEM_HUGE_DENY) SHMEM_SB(shm_mnt->mnt_sb)->huge =3D shmem_huge; else shmem_huge =3D SHMEM_HUGE_NEVER; /* just in case it was patched */ --=20 2.52.0