From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B4C22DF68; Thu, 9 Oct 2025 07:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.17.235.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759996237; cv=none; b=gx63CIBjARugO2VYGHrYQQZvNjEHg0JOXg3TgmKZ5rVxO+dkr3rITN3yJvZJPB49zYUxVF3cGrn5Waqq82MdSWTdqOOivjhIBVJ7NU6Cw1HhQhBR03ew2VeekhSE4y+GJqJ3pU0wQhmSGdPK4ygpu1gjCFqNWD9Dm9bY+CijA04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759996237; c=relaxed/simple; bh=hSDqszayzc1URyLW0uaDx+454Q64tykY5sefroniNHg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=V9LRw9WhHTQmz0MEMWmP71RVBP0QjzGhomMoTencmXvH00+R64ikqeZfJMH5mqEIGQQ+p6G5Ru9caJzrzZfF6wruvtZxQtqfB994OzTGp7PD+NB6h2+VBQzs4MBencSSMiu3V9pPwPrdTzDMi+Tdco3htJr8+1e+MW8eFyt4GB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu; spf=pass smtp.mailfrom=csgroup.eu; arc=none smtp.client-ip=93.17.235.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=csgroup.eu Received: from localhost (mailhub4.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4cj22T4GVLz9sSy; Thu, 9 Oct 2025 09:44:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e-hrpkSiMM5A; Thu, 9 Oct 2025 09:44:33 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4cj22T2bCVz9sSq; Thu, 9 Oct 2025 09:44:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3E1858B768; Thu, 9 Oct 2025 09:44:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id iEsvyTlwygx4; Thu, 9 Oct 2025 09:44:33 +0200 (CEST) Received: from [192.168.235.99] (unknown [192.168.235.99]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4940A8B767; Thu, 9 Oct 2025 09:44:31 +0200 (CEST) Message-ID: <1fb2259f-65e1-4cd0-ae70-b355843970e4@csgroup.eu> Date: Thu, 9 Oct 2025 09:44:30 +0200 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: (bisected) [PATCH v2 08/37] mm/hugetlb: check for unreasonable folio sizes when registering hstate To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: Zi Yan , Lorenzo Stoakes , "Liam R. Howlett" , Alexander Potapenko , Andrew Morton , Brendan Jackman , Christoph Lameter , Dennis Zhou , Dmitry Vyukov , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, iommu@lists.linux.dev, io-uring@vger.kernel.org, Jason Gunthorpe , Jens Axboe , Johannes Weiner , John Hubbard , kasan-dev@googlegroups.com, kvm@vger.kernel.org, Linus Torvalds , linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-ide@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mips@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, Marco Elver , Marek Szyprowski , Michal Hocko , Mike Rapoport , Muchun Song , netdev@vger.kernel.org, Oscar Salvador , Peter Xu , Robin Murphy , Suren Baghdasaryan , Tejun Heo , virtualization@lists.linux.dev, Vlastimil Babka , wireguard@lists.zx2c4.com, x86@kernel.org, "linuxppc-dev@lists.ozlabs.org" References: <20250901150359.867252-1-david@redhat.com> <20250901150359.867252-9-david@redhat.com> <3e043453-3f27-48ad-b987-cc39f523060a@csgroup.eu> From: Christophe Leroy Content-Language: fr-FR In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 09/10/2025 à 09:22, David Hildenbrand a écrit : > On 09.10.25 09:14, Christophe Leroy wrote: >> Hi David, >> >> Le 01/09/2025 à 17:03, David Hildenbrand a écrit : >>> Let's check that no hstate that corresponds to an unreasonable folio >>> size >>> is registered by an architecture. If we were to succeed registering, we >>> could later try allocating an unsupported gigantic folio size. >>> >>> Further, let's add a BUILD_BUG_ON() for checking that HUGETLB_PAGE_ORDER >>> is sane at build time. As HUGETLB_PAGE_ORDER is dynamic on powerpc, >>> we have >>> to use a BUILD_BUG_ON_INVALID() to make it compile. >>> >>> No existing kernel configuration should be able to trigger this check: >>> either SPARSEMEM without SPARSEMEM_VMEMMAP cannot be configured or >>> gigantic folios will not exceed a memory section (the case on sparse). >>> >>> Reviewed-by: Zi Yan >>> Reviewed-by: Lorenzo Stoakes >>> Reviewed-by: Liam R. Howlett >>> Signed-off-by: David Hildenbrand >> >> I get following warning on powerpc with linus tree, bisected to commit >> 7b4f21f5e038 ("mm/hugetlb: check for unreasonable folio sizes when >> registering hstate") > > Do you have the kernel config around? Is it 32bit? > > That would be helpful. That's corenet64_smp_defconfig Boot on QEMU with: qemu-system-ppc64 -smp 2 -nographic -M ppce500 -cpu e5500 -m 1G Christophe