From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CB4E33439A; Fri, 24 Jul 2026 16:31:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784910709; cv=none; b=bUIc4ADfhaUU2jVsvhdgTAb8zh+tysTYQtPjthJyJdCOQOhxcC3yqrNa1/CnB4LBYjC44E79pNVnt2PLlmmjIyXC/TXRMUiBvyZT/LBq+HROvz501AzAqadcrWt1POLpubIxSOttWd2fhhA765nzu4mg1Jg1nAqzVqCluBEr9Ug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784910709; c=relaxed/simple; bh=NEwnT35D7tuzT3xeTQQMHkJEWGepfSu0cwMv30sxXLk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=trB7VcuLSPvxptxp6Zb9oQRJBZu3Y3R+BcIQ8jRbXcIswDG/De66Vb5Frx1O7lEUS+QNcu/Vl+e79LJzLf9bp1/ydbQ8nw8W6Ocy+3FrQ+9HIHoKGDEKaSvN69OK5yJ1aHPoaOgBNeNST64MK+dVSJfFwWqPw3O5QHVoIJxDxjY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=rJ2DJJ7D; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="rJ2DJJ7D" 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 4DF711BC0; 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 Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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