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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7EC06E77188 for ; Fri, 3 Jan 2025 11:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gQiyw4nrvJkPUksRfWWFxRJR2mBO1fGIBG0LUZQtlTs=; b=NcmRP0kyFtRiUn iVQMUbu/czSrgTMAXP96LujcTfLKcTSd6Y65nrJZcSUmBX/gJ27Rw1xoAihpvZyJBX1SMwGmDiNtt A3e45OYGCP7ZJ1+5/PZQNVXqQenS+WH7ajRHDVGxSOh456aSUoi+wx22fDPsfar7BWYCzM889rfVB PjlZdzPZg7sXInd+1P02VEzYE9nZV3lgXJ5LANc1j8IYNdKs/0XvZ8hSNOuhp17/4e2dLefCAcrzr pCZoYk6ixdMbh6D28KWRIUwSJk7FH1eZ/BrRzjmXDxWP4iMn3z9zuU1MD7C2kGeKmBAt01YFYdGOu algZhxclV439AL0heF+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTff9-0000000Cny8-0ITp; Fri, 03 Jan 2025 11:16:19 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTfdw-0000000CnoI-1ZoD; Fri, 03 Jan 2025 11:15:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CPGOdr/jsXJNO5Wu3fEBGF99GP73lSQF/IKxQW4k0R4=; b=Tf96QP1nI5zee8m+i5u3CA94h9 3PVNNoLdvhSBk2t6LZQP6KHn1+Y/Ig9kK3lwT2hFjHWgZiqq3VK4SzqQBmD6A0e29acKD8NJDsAzp PBklhel75TRoOCf5VTzc00lXza1eWj1sW19Tjleo1fc/L5i9P5juDXyKQY9kHKExje/1wAmmZkrHj FdESUWBGwWEamk3EA3c0+gwV4EPoveBGXJo3r+051uO72Cz+2Bir5nMUbKQ2FfpEvF0r1gyVxRelx Ro4i1hRHlfJmHnjxqwmbD1SaYDgPeAH7HhcAneWE1IcOwP7nCEbEkp2xJxpa8O/6L3gNZJN11KFqb fYAj5NUQ==; Received: from 77-249-17-89.cable.dynamic.v4.ziggo.nl ([77.249.17.89] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tTfdp-00000005j4l-1npS; Fri, 03 Jan 2025 11:14:57 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 3EDFC3003AF; Fri, 3 Jan 2025 12:14:57 +0100 (CET) Date: Fri, 3 Jan 2025 12:14:57 +0100 From: Peter Zijlstra To: Mike Rapoport Cc: Qi Zheng , agordeev@linux.ibm.com, kevin.brodsky@arm.com, tglx@linutronix.de, david@redhat.com, jannh@google.com, hughd@google.com, yuzhao@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, lorenzo.stoakes@oracle.com, akpm@linux-foundation.org, rientjes@google.com, vishal.moola@gmail.com, arnd@arndb.de, will@kernel.org, aneesh.kumar@kernel.org, npiggin@gmail.com, dave.hansen@linux.intel.com, ryan.roberts@arm.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org Subject: Re: [PATCH v3 15/17] mm: pgtable: remove tlb_remove_page_ptdesc() Message-ID: <20250103111457.GC22934@noisy.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Sat, Dec 28, 2024 at 11:26:22AM +0200, Mike Rapoport wrote: > On Mon, Dec 23, 2024 at 05:41:01PM +0800, Qi Zheng wrote: > > Here we are explicitly dealing with struct page, and the following logic > > semms strange: > > > > tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); > > > > tlb_remove_page_ptdesc > > --> tlb_remove_page(tlb, ptdesc_page(pt)); > > > > So remove tlb_remove_page_ptdesc() and make callers call tlb_remove_page() > > directly. > > Please don't. The ptdesc wrappers are there as a part of reducing the size > of struct page project [1]. > > For now struct ptdesc overlaps struct page, but the goal is to have them > separate and always operate on struct ptdesc when working with page tables. I don't see how the current idiotic code helps with that at all. Fundamentally tlb_remove_page() is about removing *pages* as from a PTE, there should not be a page-table anywhere near here *ever*. Yes, some architectures use tlb_remove_page() for page-tables too, but that is more or less an implementation detail that can be fixed. So no, please keep these patches and kill this utterly idiotic code. The only thing that should eventually care about page-tables is tlb_remove_table(), and that takes a 'void *' and is expected to match whatever __tlb_remove_table() does. Flipping those to pgdesc, once its actually a thing, should be fairly straight forward. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv