From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH v6 00/33] Split ptdesc from struct page Date: Wed, 28 Jun 2023 19:51:09 +0100 Message-ID: References: <20230627031431.29653-1-vishal.moola@gmail.com> <90e643ca-de72-2f4c-f4fe-35e06e1a9277@google.com> <26282cb8-b6b0-f3a0-e82d-b4fec45c5f72@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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=T6BpvRiEz+8ewJPzss0e45msYW1bKUOMC3OrFkixJu4=; b=jCHcL8f7YIcjQG JlpThHHID837AfxgdvFoudBNNZ3/M5SMO7mViqKpwvVC7Q0z+oYDLYg4rt4G4fXDwVXBDF7rz08iR IgLWeCvtd3upW5KtFiiaAmSBOwrPe6FTU99nYTYGG3ZM8eWcl7m6ak9/mJnRCwV3NHaTbM40Djnlr h2ErOrCmrymtQwGUNOx/gYuPz5iOZwip7GOyOGcROE4PWkuUjkJQZVR3z1ZbWz91NOqLiaCLrHGYU OtVO85jFR0NG2y52jRQ/45N9OI05kGGE2pXahffjrpLH9VFwblckKQyYaH4JB3ZOMIOQI36Kw5mjL 0Db2dZH0i1shtKRjJNxg==; 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=gzBVL7uWfH/0QncUeiWSVvNT7tu19KKFpZm/SdtHfy0=; b=F0geF1mDFUhFwejscu79P5AerF ChPxlz8AungTNw2nYlH8TmeT0FdBYZ403uLo6dwYbFZivePasVeM2QOKhl+SGZUnj3aelPYXtEfM9 SrOHM/3oUTni3eU+S6cGIy3fXu368hUaiU/EA6YN2NOx+dDC0fkki3YX0I7X5QXDEfuDII33co6YT AgpMwEBC4ya/EPvRDl80CtdVgP3e2XagbMLqDsAoh6VP3gh2KZpEwz3m1/E0HTdSv3vSxKIUbldmu z9Fsmk0Dd2L6fefBSyj6JHJ0VqW7vTaNglMS0xkY6KNSksqhU+OkIfDiDfBXKznANmEoK/ikyWU4U 7raG+AtA==; Content-Disposition: inline In-Reply-To: <26282cb8-b6b0-f3a0-e82d-b4fec45c5f72@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+glpr-linux-riscv=m.gmane-mx.org@lists.infradead.org To: David Hildenbrand Cc: Hugh Dickins , "Vishal Moola (Oracle)" , Andrew Morton , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.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, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, Catalin Marinas , Huacai Chen , Geert Uytterhoeven , Thomas Bogendoerfer , Dinh Nguyen , Jonas Bonn , Claudio Imbrenda On Wed, Jun 28, 2023 at 09:41:18AM +0200, David Hildenbrand wrote: > I'm not a friend of these "overlays"; it all only really makes sense to me > once we actually allocate the descriptors dynamically. Maybe some of the > existing/ongoing conversions were different (that's why I was asking for the > difference, as you said the "struct slab" thing was well received). > > If they are primarily only unnecessary churn for now (and unclear when/how > it will become useful), I share your opinion. One of the reasons for doing these conversions "early" is that it helps people who work on this code know what fields they can actually use in their memory descriptor. We have a _lot_ of historical baggage with people just using random bits in struct page for their own purposes without necessarily considering the effects on the rest of the system. By creating specific types for each user of struct page, we can see what's actually going on. Before the ptdesc conversion started, I could not have told you which bits in struct page were used by the s390 code. I knew they were playing some fun games with the refcount (it's even documented in the s390 code!) but I didn't know they were using ... whetever it is; page->private to point to the kvm private data? So maybe it is harder for MM developers right now to see what fields in memdesc A overlap with which fields in memdesc B. That _ought_ not to be a concern! We document which fields are available in each memdesc, and have various assertions to trip when people make things not line up any more. There can still be problems, of course; we haven't set the assertions quite tightly enough in some cases. People are going to keep adding crap to struct page, and they're going to keep misusing the crap that's in struct page. That has to stop.