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 5C673331A7D for ; Mon, 17 Nov 2025 19:01:56 +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=1763406118; cv=none; b=ZzUyAgaXuRW7+Ti9jqwn8+bHuk059tqjZhrFEwRBXJXrBZDfQG/sOfge9/OxGjh1xJtEUMAVTq2w3lo3aHF6dTpt1WeTCdn1qPPIAEJWRmw7wrK0tKWx+drH6nudoUYzh6dumje+7a9elVaTa8Ex17lTuc0OifNA9z960x/NoRk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763406118; c=relaxed/simple; bh=7+6Cd83Mk/yPcpiUUk7SexYJ2WfuJAQjB7BTQIJtLLQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IlcsWNBA7xBv2wWt9nkY76QKFvoswNYdYJRpr22ZtOQqvrfCevLbYqzk2DbARRtCl23N4xgBFX2imd0PYfsfjYTw87i0i5pbEuhdDkqOwcc37y9flSFXcNHDEOyA/JvD4hppsPLE0E6yMBVMzZY/hjxYrahSV85tJZYJHtbYspA= 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=YGNvjx07; 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="YGNvjx07" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763406115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=omm+YOSkkA/S4z6yh1bZVUMItoFqXoIoAr5Y3phS6u4=; b=YGNvjx07DolV82tNZTxhGH5rE6VXJMGsaJdUrd+Rbyk6s9bitlXYeHyxWdRQyhLEb2RjLF n4dvtWyeHs8J+8cN964+Doxzf1lSFA50GwBlpM35U71wM6PQ25mv3PtqiKxBV/+9M0gbiu LSDCPpDKFVt8R3292x4zLJlLvFpvqqg= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-394-JnznEZWkOA-mTzNSKerG8g-1; Mon, 17 Nov 2025 14:01:54 -0500 X-MC-Unique: JnznEZWkOA-mTzNSKerG8g-1 X-Mimecast-MFC-AGG-ID: JnznEZWkOA-mTzNSKerG8g_1763406113 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8b225760181so590632085a.2 for ; Mon, 17 Nov 2025 11:01:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763406113; x=1764010913; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=omm+YOSkkA/S4z6yh1bZVUMItoFqXoIoAr5Y3phS6u4=; b=i5JJ8gpQsfVAileKSOPJI3nyujEcZ6eUyUU9x0XgKBlYX9Cz1W1aVqW23//NYEgRcJ 92Ew2+XopzKaA3/es43pP44nJdfSMNlOBHj6VQzmyPAfVeD6Yw0Pl9l9KPjcv2qq2K1b +3p0CJIq1iHp56BnLqZOEKgrGLSvk7m99XE1A5LjWFFGaIY/3cI0X4pUeYryp76TYC53 Juuip9X8Pg5+KPIUQlnQwbN7g+Z6IqBzVmtvvHJBFOtQfbqRheNFDfA0lID8M0jBqUro 1Jd3iO33FogWUGl1OogFaTAZBJwi/SMnF/IMIanPMw+9Hm4oP6wfSzVAfBh3/0yhV5Pr xkQQ== X-Forwarded-Encrypted: i=1; AJvYcCUj4sdcMkfxr00EmJmWR89sZ4hlvmY0LaYJBTqWAZutZ9DJrZSzG10JowweSpkjMa/Box8TGYtw1Pd0ppQ=@vger.kernel.org X-Gm-Message-State: AOJu0Ywqm6EkqR/mGUGnCrvSpkOg4GWikR79zZoOVBNZaZ7pq7ym2WkK uMSIJGw2P3aX/90s09c8JqUSZvUXWG+Jq3Hd5/wdLtTKodc815eQAQmWlJojsYPqV0YBmTz9YF+ oRdLkSRhdHyzmJj1lQBhA+9r5ynBTyoEy6fSTuKBDsz7zeX8/p46eqlaGSClLbEPswQ== X-Gm-Gg: ASbGncvBjKqxtWIlT4xWjFuQqt3Jqq8gXaeijdhTpytwV13tRYEBpKdFTA1yIkFIlN3 UDXGtBWHuMH+yfPIgMlF1qi/UIm4hkGoGxADHyC5wxBcS923ieZi7S9MzgDgyBvO0Wa/rVWQDC2 ZbZeAemyIrkzxKXIhC23KK4XiEUKJG15lKEiOlE2T58PCaq81EII5r4zBjOBaZc+tGOiZVO7JpH w9sYnrrZGpIJ44bwyxYC4jTmyXPiW4MT+KqcWfs+kYt1DfLol7CTYbUN0r1A+9213qRocS2M+b6 LSlFBvbUMB/qBhUv52Zf7m2d7u25tpXhHLZWe+EclDCeNOyS+gHZgYqF1iDVMjiXympm59orlmW eDt4c/idFezI= X-Received: by 2002:a05:620a:4096:b0:8b2:4b6:22d4 with SMTP id af79cd13be357-8b2c31ca52fmr1794670785a.84.1763406113366; Mon, 17 Nov 2025 11:01:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlfkBq/1YcPuABFdAF4J1QzzNZOoBXFo8Tv61v/46sUxqJNVdZmKCXTJyhpM4K7Po7LkpEfg== X-Received: by 2002:a05:620a:4096:b0:8b2:4b6:22d4 with SMTP id af79cd13be357-8b2c31ca52fmr1794665185a.84.1763406112828; Mon, 17 Nov 2025 11:01:52 -0800 (PST) Received: from [192.168.2.110] ([76.65.77.217]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8b2aeeaf9d9sm1030577285a.16.2025.11.17.11.01.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Nov 2025 11:01:52 -0800 (PST) Message-ID: <65b0c614-e6a9-4535-9d30-bd2be7a72149@redhat.com> Date: Mon, 17 Nov 2025 14:01:49 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 07/10] treewide: rename has_transparent_hugepage() to arch_has_pmd_leaves() To: "David Hildenbrand (Red Hat)" , linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: ryan.roberts@arm.com, akpm@linux-foundation.org, lorenzo.stoakes@oracle.com References: <9b56da53df2f0da40be68de9a7208d527b144afa.1762464515.git.luizcap@redhat.com> Content-Language: en-US, en-CA From: Luiz Capitulino In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025-11-17 12:45, David Hildenbrand (Red Hat) wrote: > On 06.11.25 22:28, Luiz Capitulino wrote: >> Now that the majority of has_transparent_hugepage() callers have been >> converted to pgtable_has_pmd_leaves(), rename has_transparent_hugepage() >> to arch_has_pmd_leaves() since that's what the helper checks for. >> >> arch_has_pmd_leaves() is supposed to be called only by >> init_arch_has_pmd_leaves(), except for two exeptions: >> >> 1. shmem: shmem code runs very early during boot so it can't use >> pgtable_has_pmd_leaves() > > Can't we just initialize pgtable_has_pmd_leaves() earlier then? I can look into doing that. When I worked on this RFC I wondered if arch_has_pmd_leaves() (when implemented by the arch) could run so early given that some (all?) archs check feature bits so they must be available this early as well. But I'll check this, having pgtable_has_pmd_leaves() being available as early as possible is probably the right thing to do. >> 2. hugepage_init(): just a temporary exception, this function will be >> converted in a future commit >> >> Signed-off-by: Luiz Capitulino >> --- > > > [...] > >> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h >> index e4c5f70b0a01..02a2772ec548 100644 >> --- a/include/linux/pgtable.h >> +++ b/include/linux/pgtable.h >> @@ -2026,8 +2026,8 @@ static inline bool pgtable_has_pmd_leaves(void) >> #endif >> #endif >> -#ifndef has_transparent_hugepage >> -#define has_transparent_hugepage() IS_BUILTIN(CONFIG_TRANSPARENT_HUGEPAGE) >> +#ifndef arch_has_pmd_leaves >> +#define arch_has_pmd_leaves() IS_BUILTIN(CONFIG_TRANSPARENT_HUGEPAGE) >> #endif > > Ah, so it stays for now only set with CONFIG_TRANSPARENT_HUGEPAGE. I guess that's something to sort out later :) I suggested something we could do in this series. Also, I skipped commenting on all the cases you spotted as I think they refer to the same issue (please, do point out if you think I'm wrong).