mm: alloc_anon_folio: avoid doing vma_thp_gfp_mask in fallback cases
Subsystems (2)
PATCH 1/1 mm: alloc_anon_folio: avoid doing vma_thp_gfp_mask in fallback cases
From: Barry Song <[email protected]>
Fallback rates surpassing 90% have been observed on phones utilizing 64KiB CONT-PTE mTHP. In these scenarios, when one out of every 16 PTEs fails to allocate large folios, the remaining 15 PTEs fallback. Consequently, invoking vma_thp_gfp_mask seems redundant in such cases. Furthermore, abstaining from its use can also contribute to improved code readability.
--- mm/memory.c | 3 +++ 1 file changed, 3 insertions(+)
mm/memory.c +3 -0
@@ -4353,6 +4353,9 @@ static struct folio *alloc_anon_folio(struct vm_fault *vmf)pte_unmap (pte); +if (!orders) + goto fallback; +/* Try allocating the highest of the remaining orders. */ gfp =vma_thp_gfp_mask (vma);while (orders) {
Signature · 1 line
2.34.1
Quoted 8 lines · Barry Song
From: Barry Song <[email protected]>
Fallback rates surpassing 90% have been observed on phones utilizing 64KiB CONT-PTE mTHP. In these scenarios, when one out of every 16 PTEs fails to allocate large folios, the remaining 15 PTEs fallback. Consequently, invoking
vma_thp_gfp_maskseems redundant in such cases. Furthermore, abstaining from its use can also contribute to improved code readability.
Quoted 28 lines · Barry Song
From: Barry Song <[email protected]>
Fallback rates surpassing 90% have been observed on phones utilizing 64KiB CONT-PTE mTHP. In these scenarios, when one out of every 16 PTEs fails to allocate large folios, the remaining 15 PTEs fallback. Consequently, invoking
vma_thp_gfp_maskseems redundant in such cases. Furthermore, abstaining from its use can also contribute to improved code readability.Cc Ryan Roberts <[email protected]>Cc Kefeng Wang <[email protected]>Cc John Hubbard <[email protected]>Cc David Hildenbrand <[email protected]>Cc Alistair Popple <[email protected]>Cc Anshuman Khandual <[email protected]>Cc Catalin Marinas <[email protected]>Cc David Rientjes <[email protected]>Cc "Huang, Ying" <[email protected]>Cc Hugh Dickins <[email protected]>Cc Itaru Kitayama <[email protected]>Cc Kirill A. Shutemov <[email protected]>Cc Luis Chamberlain <[email protected]>Cc Matthew Wilcox (Oracle) <[email protected]>Cc Vlastimil Babka <[email protected]>Cc Yang Shi <[email protected]>Cc Yin Fengwei <[email protected]>Cc Yu Zhao <[email protected]>Cc Zi Yan <[email protected]>Signed-off-by Barry Song <[email protected]>
Quoted 3 lines
--- mm/memory.c | 3 +++ 1 file changed, 3 insertions(+)
LGTM. Reviewed-by: Zi Yan <[email protected]>
--
Best Regards,
Yan, Zi
Quoted 20 lines · Barry Song
From: Barry Song <[email protected]>
Fallback rates surpassing 90% have been observed on phones utilizing 64KiB CONT-PTE mTHP. In these scenarios, when one out of every 16 PTEs fails to allocate large folios, the remaining 15 PTEs fallback. Consequently, invoking
vma_thp_gfp_maskseems redundant in such cases. Furthermore, abstaining from its use can also contribute to improved code readability.Cc Ryan Roberts <[email protected]>Cc Kefeng Wang <[email protected]>Cc John Hubbard <[email protected]>Cc David Hildenbrand <[email protected]>Cc Alistair Popple <[email protected]>Cc Anshuman Khandual <[email protected]>Cc Catalin Marinas <[email protected]>Cc David Rientjes <[email protected]>Cc "Huang, Ying" <[email protected]>Cc Hugh Dickins <[email protected]>Cc Itaru Kitayama <[email protected]>Cc Kirill A. Shutemov <[email protected]>
Quoted 8 lines
Cc Luis Chamberlain <[email protected]>Cc Matthew Wilcox (Oracle) <[email protected]>Cc Vlastimil Babka <[email protected]>Cc Yang Shi <[email protected]>Cc Yin Fengwei <[email protected]>Cc Yu Zhao <[email protected]>Cc Zi Yan <[email protected]>Signed-off-by Barry Song <[email protected]>
Quoted 18 lines
--- mm/memory.c | 3 +++ 1 file changed, 3 insertions(+)mm/memory.c +3
-0@@ -4353,6 +4353,9 @@ static struct folio *alloc_anon_folio(struct vm_fault *vmf)pte_unmap (pte); +if (!orders) + goto fallback; +/* Try allocating the highest of the remaining orders. */ gfp =vma_thp_gfp_mask (vma);while (orders) {