From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 756AF2D8DD6 for ; Wed, 29 Apr 2026 14:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777473569; cv=none; b=qaf6BWk6XC2SeDZJvhW1VOomEfVEYVKD3kIL3gZqD5TGe6KU1aFWrKox0RJB1db23FiKZDZDXgRbpPGUsHe5xuI/osishB7NM67Y1LXlPFQGoyLgbOdgLeegWKD7ovgms+45rsisztlJ5a17smPM6mSvZVnAAPSKT6gXbcG98iE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777473569; c=relaxed/simple; bh=sKA5t1qASE9cW6MaMM7IdTUU1YHWqNLeukMxRfVBTYA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NvJ6oh6P4yRoocCeNRIblQLY542Jk13DhIdxw28qJoi8YQGXpOsnk+m4nHx3rQQ7J9E3ild54uYCWHcTqT4hEtGLTuYos2HHa4gDAYxorSc9f2UfuD1opR+mcAC7AqlrU+HHVH/XZU4kEaqvc3CAcoAeMJH5MmH80s4fUDyWzcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=lTQRCUMq; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="lTQRCUMq" 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=kRbeh6wzSFJBhsD1IBNYmNNlFjofOgPhy7oVVu0x4xk=; b=lTQRCUMqGKMlpPmKbESczV0lP3 PCdOi4thZ2sDEeaUsYySlcjyAfRXoPLDpPhKSBHXuLOXpuDdmqNIrb9S787c/lPu4VdK8EIdLmRh2 c9Lgecuet664qWDe5OP8sZ99WOMzCdqYiDlF3iCwpgwhqvXVu5c0AbiX5TBt1U7dMHsUDyJP3DaeK Mf+3Gf0w/JI9o9CqKynpAGQtC7UkgC4fjesH8RwJZAdpY0H6ZIKG5SjFoyKrLV8zM6Vfj7l76L/8y OPNMWKKpdjU1jZNG7gvmI0waWPZn4UIw9D9TFBfozuKsIfK2fxWS9lKVFbW+OqZ7vAuVNN4VfyBkW RuyIo+9Q==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1wI64N-00000005i97-09x5; Wed, 29 Apr 2026 14:39:19 +0000 Date: Wed, 29 Apr 2026 15:39:18 +0100 From: Matthew Wilcox To: Kiryl Shutsemau Cc: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , David Hildenbrand , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , Johannes Weiner , Usama Arif Subject: Re: [LSF/MM/BPF TOPIC] 64k (or 16k) base page size on x86 Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 19, 2026 at 03:08:51PM +0000, Kiryl Shutsemau wrote: > No, there's no new hardware (that I know of). I want to explore what page size > means. > > The kernel uses the same value - PAGE_SIZE - for two things: > > - the order-0 buddy allocation size; > > - the granularity of virtual address space mapping; > > I think we can benefit from separating these two meanings and allowing > order-0 allocations to be larger than the virtual address space covered by a > PTE entry. I actually want to go in the other direction. I once came up with a name -- POTAM -- which stands for Power Of Two Allocator with Metadata. The use case was something like XFS's buffer cache where we want a filesystem block size of data (so 0.5KiB to 64KiB) with some metadata attached (xfs_buf is 664 bytes with debugging enabled!) I set this aside to work on folios, but folios offer a back door to unifying this with the buddy allocator. It's a long road, but here's a sketch: First, we separate memdescs from pages. I believe this lets us shrink struct page down to 8 bytes (previously presented as various LSFMMs). Second, we get rid of 'page' in things like sglist and bvec. This is already in progress for various other good reasons. Third (this bit is new), we replace memmap with something like a maple tree. That lets us lookup memdescs by physical address (typically a memdesc will contain either the physical or virtual address of the memory it controls). Fourth, we change the unit of the lookup in the maple tree from being a PFN to being address / 512 (or whatever size we want to use as our minimum). Now we can have memdescs for an arbitrary power of two which means we can ditch all the awful code from ppc/s390 page table handling where they try to share one memdesc between several different page tables. It's going to be "fun" avoiding allocation deadlocks where we want to rebalance the maple tree containing the memdescs ... that's a five year away problem.