]> git.ipfire.org Git - thirdparty/linux.git/commit
mm: shmem: allow fallback to smaller large orders for tmpfs mmap() access
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Fri, 14 Nov 2025 00:46:32 +0000 (08:46 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 24 Nov 2025 23:08:53 +0000 (15:08 -0800)
commit8826f09616b475361774588c3e07260bba548f84
tree9a979f55afd8260ed4bf40bfed73e8b445dd8c80
parent1b1a4e4d6797a57fefa40569fc920ce573bbf75b
mm: shmem: allow fallback to smaller large orders for tmpfs mmap() access

After commit 69e0a3b49003 ("mm: shmem: fix the strategy for the tmpfs
'huge=' options"), we have fixed the large order allocation strategy for
tmpfs, which always tries PMD-sized large folios first, and if that fails,
falls back to smaller large folios.  For tmpfs large folio allocation via
mmap(), we should maintain the same strategy as well.  Let's unify the
large order allocation strategy for tmpfs.

There is no functional change for large folio allocation of anonymous shmem.

Link: https://lkml.kernel.org/r/283a0bdfd6ac7aa334a491422bcae70919c572bd.1763008453.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/shmem.c