From mboxrd@z Thu Jan 1 00:00:00 1970 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 8A3A53F39ED for ; Fri, 29 May 2026 14:56:58 +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=1780066619; cv=none; b=a3EE56ryu07gFqR0z0om7iAXRU1pXKJ16yMl0SGGrTZxQgbLWiD1w/15eLljF1lCk2KltoJd+if2AHHSiczxb6mjzN5T7zGdHRcVBAjz59esq2h3q3Ffvu5CElVwrslsWhMYDDbwm7z25yCohBA9P3RyvLxeVgh0LIaCw5PbOYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780066619; c=relaxed/simple; bh=ghVp49JA3z0UT3TXrewzKk7yhvaLf6rKo6/MV9xwIwA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YdtF04/BeSewhTC8QVJ3i/Wr4IdSjcgigMbjkoTv3MfPqxQPG8/2EVCfivS9iH7fJHm95lI0yp7x9iw3o3PDbvx+Vet3oEBZQPtGwNqkPAaOHUQUEjHvd6hMFO5ZivqZ19XQcmStZnbd3A8D+WQiJipowS+JFfDtugWnrY54fHI= 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=JoxeR45N; 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="JoxeR45N" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780066617; 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=H/KxrY6mrVUmdE4Wf1xkGQbDrlUS1KgRvFUz3Rv9DKg=; b=JoxeR45NG47u5x6s8ZZ3yqq/aHoK5N+jm9NPKKbunzOnDT+LuYi2A9CSVjLZDkPodUOZ9y jEnSohKuqqqf8j2xxTt4raSBebMesin/PVqWoPYPPh/fM3QiCssivBhoF31LFTk2bsemmU VRk5cH+vd/Or4VRea3ozLiX71yZO+KY= 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-148-dQQTWKBsMxiP-J-jQ9IIHA-1; Fri, 29 May 2026 10:56:50 -0400 X-MC-Unique: dQQTWKBsMxiP-J-jQ9IIHA-1 X-Mimecast-MFC-AGG-ID: dQQTWKBsMxiP-J-jQ9IIHA_1780066607 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7056D1800343; Fri, 29 May 2026 14:56:47 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.64.88]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5F073002D2D; Fri, 29 May 2026 14:56:43 +0000 (UTC) From: Luiz Capitulino To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, david@kernel.org, baolin.wang@linux.alibaba.com, ziy@nvidia.com, lance.yang@linux.dev Cc: corbet@lwn.net, tsbogend@alpha.franken.de, maddy@linux.ibm.com, mpe@ellerman.id.au, agordeev@linux.ibm.com, gerald.schaefer@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, x86@kernel.org, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, ira.weiny@intel.com, hughd@google.com, dave.hansen@linux.intel.com, djbw@kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, akpm@linux-foundation.org, yintirui@huawei.com, ljs@kernel.org Subject: [PATCH v5 11/14] x86: move has_transparent_hugepage() out of THP guard Date: Fri, 29 May 2026 10:55:29 -0400 Message-ID: <5e980fed03f7c3161a850cddfc3c876c72c71cbe.1780066530.git.luizcap@redhat.com> 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: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 has_transparent_hugepage() definition is guarded by CONFIG_TRANSPARENT_HUGEPAGE, but there's a need to use it when CONFIG_TRANSPARENT_HUGEPAGE=n. Move the definition out of the THP guard. Signed-off-by: Luiz Capitulino --- arch/x86/include/asm/pgtable.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 2187e9cfcefa..30fd1fa034e4 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -306,12 +306,6 @@ static inline int pud_trans_huge(pud_t pud) } #endif -#define has_transparent_hugepage has_transparent_hugepage -static inline int has_transparent_hugepage(void) -{ - return boot_cpu_has(X86_FEATURE_PSE); -} - #ifdef CONFIG_ARCH_SUPPORTS_PMD_PFNMAP static inline bool pmd_special(pmd_t pmd) { @@ -337,6 +331,12 @@ static inline pud_t pud_mkspecial(pud_t pud) #endif /* CONFIG_ARCH_SUPPORTS_PUD_PFNMAP */ #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ +#define has_transparent_hugepage has_transparent_hugepage +static inline int has_transparent_hugepage(void) +{ + return boot_cpu_has(X86_FEATURE_PSE); +} + static inline pte_t pte_set_flags(pte_t pte, pteval_t set) { pteval_t v = native_pte_val(pte); -- 2.54.0