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 E4E51280A29 for ; Tue, 17 Feb 2026 15:22:50 +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=1771341773; cv=none; b=rCtLS2iAx9qWM6TZUKICX3NzP16n4AMfaU2qnFx31uC18e2dRnzxwE3Vx5Y8bxmDOLP1tY8XGxf+iX8LdmNEt+CcBbR90re35K2E+5Odz6c+kUT4SCK1DgAY1P2Me8MKgVv6H9P39JdGp8u1LnjRxnOsreODh4OpddRe8igZjL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771341773; c=relaxed/simple; bh=HYFsWa0EK1mOB4YjgFHmspZnNoPGz9yizNktJcf15GQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oXVV3s3NWY1hLgbEAOnwIf3Ko7EYkwsu3uEXHmT3ao+xUesGlUX+68dXtpAGt73x3g7zxoRgASm7l36aax1e3RXrKCakaxYnxYUJhq1Q4QN9jJxbJkodvMHdFSS6uhEsR1MCbpBO+lmzCeQ4JCgUdsucqkjmNDoxETfVqK/mHWQ= 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=cJhz2one; 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="cJhz2one" 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=3v3iihKPRUq2lJ7DpDwis3kzOh/HRjfIlqh2T2bN4Go=; b=cJhz2onesJWPuSPL6UovTP28i0 YWnL2OjoVBVS3poln5ga6VoZExz7eNAGEfM4FuokslPZdMLlJFPjHjaEo6wAe+9oyBjseHroeEcMq D99BawkmyMO07Tjk+u4sm0GGA7M7WQ/MGKb4QKcuUmtMWuEQVWosFadafbHFUUO5iyVC6pHcVxQwU bSTrXdA5pYkE9riOouKrtZev5ZjrnzEYwbs0yDS4wYpTWUA5wkbjo2YFNuq9i4xaccVb0wLMzCuZ1 po8qhRcjhPoOB8ryWMxC60GtPzIRAGxFemilPIBdgp6KKDlTbhRm/I3gBmVEZOJUj9QsjWWAz9gjJ vybrXPjw==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1vsMuM-00000004am9-3gxc; Tue, 17 Feb 2026 15:22:38 +0000 Date: Tue, 17 Feb 2026 15:22:38 +0000 From: Matthew Wilcox To: Dev Jain Cc: lsf-pc@lists.linux-foundation.org, ryan.roberts@arm.com, catalin.marinas@arm.com, will@kernel.org, ardb@kernel.org, hughd@google.com, baolin.wang@linux.alibaba.com, akpm@linux-foundation.org, david@kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [LSF/MM/BPF TOPIC] Per-process page size Message-ID: References: <20260217145026.3880286-1-dev.jain@arm.com> 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: <20260217145026.3880286-1-dev.jain@arm.com> On Tue, Feb 17, 2026 at 08:20:26PM +0530, Dev Jain wrote: > 2. Generic Linux MM enlightenment > --------------------------------- > We enlighten the Linux MM code to always hand out memory in the granularity Please don't use the term "enlighten". Tht's used to describe something something or other with hypervisors. Come up with a new term or use one that already exists. > File memory > ----------- > For a growing list of compliant file systems, large folios can already be > stored in the page cache. There is even a mechanism, introduced to support > filesystems with block sizes larger than the system page size, to set a > hard-minimum size for folios on a per-address-space basis. This mechanism > will be reused and extended to service the per-process page size requirements. > > One key reason that the 64K kernel currently consumes considerably more memory > than the 4K kernel is that Linux systems often have lots of small > configuration files which each require a page in the page cache. But these > small files are (likely) only used by certain processes. So, we prefer to > continue to cache those using a 4K page. > Therefore, if a process with a larger page size maps a file whose pagecache > contains smaller folios, we drop them and re-read the range with a folio > order at least that of the process order. That's going to be messy. I don't have a good idea for solving this problem, but the page cache really isn't set up to change minimum folio order while the inode is in use. > - Are there other arches which could benefit from this? Some architectures walk the page tables entirely in software, but on the other hand, those tend to be, er, "legacy" architectures these days and it's doubtful that anybody would invest in adding support. Sounds like a good question for Arnd ;-) > - What level of compatibility we can achieve - is it even possible to > contain userspace within the emulated ABI? > - Rough edges of compatibility layer - pfnmaps, ksm, procfs, etc. For > example, what happens when a 64K process opens a procfs file of > a 4K process? > - native pgtable implementation - perhaps inspiration can be taken > from other arches with an involved pgtable logic (ppc, s390)? I question who decides what page size a particular process will use. The programmer? The sysadmin? It seems too disruptive for the kernel to monitor and decide for the app what page size it will use.