summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2024-12-06 15:03:45 +0800
committerAndrew Morton <akpm@linux-foundation.org>2024-12-30 17:59:06 -0800
commit34d7cf637c437d5c2a8a6ef23ea45193bad8a91c (patch)
tree3284af40ee25d02f4f5d684ff88fd443136f1e97 /lib
parent6aaced5abd32e2a57cd94fd64f824514d0361da8 (diff)
downloadlinux-34d7cf637c437d5c2a8a6ef23ea45193bad8a91c.tar.gz
linux-34d7cf637c437d5c2a8a6ef23ea45193bad8a91c.tar.bz2
linux-34d7cf637c437d5c2a8a6ef23ea45193bad8a91c.zip
mm: don't try THP alignment for FS without get_unmapped_area
Commit ed48e87c7df3 ("thp: add thp_get_unmapped_area_vmflags()") changes thp_get_unmapped_area() to thp_get_unmapped_area_vmflags() in __get_unmapped_area(), which doesn't initialize local get_area for anonymous mappings. This leads to us always trying THP alignment even for file_operations which have a NULL ->get_unmapped_area() callback. Since commit efa7df3e3bb5 ("mm: align larger anonymous mappings on THP boundaries") we only want to enable THP alignment for anonymous mappings, so add a !file check to avoid attempting THP alignment for file mappings. Found issue by code inspection. THP alignment is used for easy or more pmd mappings, from vma side. This may cause unnecessary VMA fragmentation and potentially worse performance on filesystems that do not actually support THPs and thus cannot benefit from the alignment. Link: https://lkml.kernel.org/r/20241206070345.2526501-1-wangkefeng.wang@huawei.com Fixes: ed48e87c7df3 ("thp: add thp_get_unmapped_area_vmflags()") Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Reviewed-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: Yang Shi <shy828301@gmail.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: David Hildenbrand <david@redhat.com> Cc: Jann Horn <jannh@google.com> Cc: Liam R. Howlett <Liam.Howlett@Oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Rick Edgecombe <rick.p.edgecombe@intel.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions