From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FF36C531C9 for ; Fri, 24 Jul 2026 16:32:22 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4h6D6X3zvJz2yYf; Sat, 25 Jul 2026 02:32:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1784910740; cv=none; b=lXw90T91xt4+h5m/+9BOwEFvTYReOP42OuifYWG5R4lornJPaAtzcGEsjUySp6w/5OistW2rEVrW+dxl2kvrPn4y7kaVjLm+LJXAq2xRdxe0HvqhHpWgp19NYlHaVks9tOUqqo22rfCBOQmgqnjwqx+70rYVGQrpOxmv/xteXDciaTFQGPnf2st+0jLEpv5qgB62E8wdGz8zJEPq4G+XUlAVxyHkVk/L0A/Rnq3QaS9QdFIOPV4sjGmUKm6A4vpPcog0l0CrEdi5uzLqjSdDqe4nd8F2FlFC9i9f3ZxX00edz4ng5E2HTsw5u1YkGTyuxj/NswF0Cr7XpeiwLflOkw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1784910740; c=relaxed/relaxed; bh=NEwnT35D7tuzT3xeTQQMHkJEWGepfSu0cwMv30sxXLk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PkMK9IJaSXgknaz97dInXSEL9SjblYn3sH0bN+7plRP7WrnC2wkoUzpF3XErZ3+OoTnP2/3j8Qx/2U1I9onhspyStkSy2O6dtj9Nt4MObkONExf6wEDEFr9uPKDGB3Nk6PRkUth7WUiY8CbBOjV2aRseaRBeyaCMx96pHD/TM3zeN+HHRYDclLYcbjucV8megNMNPp/BUzOuRW64yS8lUiziMHByH0ZxAw5UAKJfPWSsGdBZtGEGFUR9OffIALM8kOB8g00rQWs0YqQyOM7mQso+ey2V3+g8Uwqw8bjD/Sz38etzQPsiTmzRg9KD7TQG7acj1E0i4apvfIHMD7eb9A== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=arm.com; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=rJ2DJJ7D; dkim-atps=neutral; spf=pass (client-ip=217.140.110.172; helo=foss.arm.com; envelope-from=kevin.brodsky@arm.com; receiver=lists.ozlabs.org) smtp.mailfrom=arm.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=rJ2DJJ7D; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=arm.com (client-ip=217.140.110.172; helo=foss.arm.com; envelope-from=kevin.brodsky@arm.com; receiver=lists.ozlabs.org) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lists.ozlabs.org (Postfix) with ESMTP id 4h6D6W4RxQz2yPR for ; Sat, 25 Jul 2026 02:32:18 +1000 (AEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4AE7F1BB2; Fri, 24 Jul 2026 09:31:43 -0700 (PDT) Received: from [10.57.0.90] (unknown [10.57.0.90]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ACA703F66F; Fri, 24 Jul 2026 09:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784910707; bh=NEwnT35D7tuzT3xeTQQMHkJEWGepfSu0cwMv30sxXLk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=rJ2DJJ7D9c7D1FVu9FvWF7Hq7v5HoLI/CdhriAp1fJ4dLBnD8EJRRWBa3d3TSeSRj y4giJ+zCCtRJVGca1Zy4119yCr4CT8kuPBEs9cPEAEswfrfTiiEZd9fOxFya5yiDAq 5lH15CX22toaprtjLQyFDxQHqVRAyMvOmxdmryBU= Message-ID: Date: Fri, 24 Jul 2026 18:31:32 +0200 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 14/22] mm: set page table page type when allocated To: Vishal Moola Cc: linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Pasha Tatashin , Russell King , Catalin Marinas , Will Deacon , Ryan Roberts , linux-arm-kernel@lists.infradead.org, Huacai Chen , loongarch@lists.linux.dev, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Madhavan Srinivasan , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Gerald Schaefer , linux-s390@vger.kernel.org, "David S. Miller" , Andreas Larsson , sparclinux@vger.kernel.org, Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Ning Sun , x86@kernel.org, tboot-devel@lists.sourceforge.net, Ard Biesheuvel , Ilias Apalodimas , linux-efi@vger.kernel.org, Alistair Popple , "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org References: <20260714-remove_pgtable_cdtor-v1-0-44be8a7685d7@arm.com> <20260714-remove_pgtable_cdtor-v1-14-44be8a7685d7@arm.com> From: Kevin Brodsky Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 20/07/2026 21:05, Vishal Moola wrote: > On Thu, Jul 16, 2026 at 11:49:31AM +0200, Kevin Brodsky wrote: >>> We should switch over from __folio_set_pgtable() to __SetPagePgtable() >>> in this patch. Ptdescs and folios should be treated as distinctly >>> independent of each other. >> I sure remember the previous discussion, but my reading of your comments >> [1] is that we cannot really change this as long as pagetable_alloc() >> can be called with order > 0, right? Multiple archs still rely on that. > Kinda... > > The concern was about callers accessing tail pages directly for that > information. Using the folio API ensures that we always look into the > head page. > > Since we're now doing it at allocation time, we know we always have the > head page, so it's fine. Ah got it, that makes sense. > > The dtor/free should be more questionable because the underlying api > uses virt_to_page() which could look at a tail page... oopsie. I > haven't seen any reports tied to it so its probably fine (the > setting/clearing has been using the folio API since ptdescs). Right, that should be fine - calling pagetable_free() on anything else than a ptdesc allocated by pagetable_alloc() is a bug, so if we get any crash because of this we should just go and fix the underlying issue. I'd still switch to __SetPagePgtable() in a separate commit to improve bisectability. FWIW there are definitely cases where pagetable_free() and pagetable_alloc() calls aren't properly matched (see my reply to the cover letter), this needs to be addressed for this series anyway. > We can say thats a happy accident that makes distinguishing ptdescs > and folios easier :) Indeed! - Kevin