lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a18b46b1-7b7d-4cd0-aa68-d715b0c16822@arm.com>
Date: Tue, 2 Apr 2024 08:58:22 +0100
From: Ryan Roberts <ryan.roberts@....com>
To: Barry Song <21cnbao@...il.com>, akpm@...ux-foundation.org,
 linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org, Barry Song <v-songbaohua@...o.com>,
 Kefeng Wang <wangkefeng.wang@...wei.com>, John Hubbard
 <jhubbard@...dia.com>, David Hildenbrand <david@...hat.com>,
 Alistair Popple <apopple@...dia.com>,
 Anshuman Khandual <anshuman.khandual@....com>,
 Catalin Marinas <catalin.marinas@....com>,
 David Rientjes <rientjes@...gle.com>, "Huang, Ying" <ying.huang@...el.com>,
 Hugh Dickins <hughd@...gle.com>, Itaru Kitayama <itaru.kitayama@...il.com>,
 "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
 Luis Chamberlain <mcgrof@...nel.org>, Matthew Wilcox <willy@...radead.org>,
 Vlastimil Babka <vbabka@...e.cz>, Yang Shi <shy828301@...il.com>,
 Yin Fengwei <fengwei.yin@...el.com>, Yu Zhao <yuzhao@...gle.com>,
 Zi Yan <ziy@...dia.com>
Subject: Re: [PATCH] mm: alloc_anon_folio: avoid doing vma_thp_gfp_mask in
 fallback cases

On 29/03/2024 07:37, Barry Song wrote:
> From: Barry Song <v-songbaohua@...o.com>
> 
> 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.
> 
> Cc: Ryan Roberts <ryan.roberts@....com>
> Cc: Kefeng Wang <wangkefeng.wang@...wei.com>
> Cc: John Hubbard <jhubbard@...dia.com>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Alistair Popple <apopple@...dia.com>
> Cc: Anshuman Khandual <anshuman.khandual@....com>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: David Rientjes <rientjes@...gle.com>
> Cc: "Huang, Ying" <ying.huang@...el.com>
> Cc: Hugh Dickins <hughd@...gle.com>
> Cc: Itaru Kitayama <itaru.kitayama@...il.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Cc: Luis Chamberlain <mcgrof@...nel.org>
> Cc: Matthew Wilcox (Oracle) <willy@...radead.org>
> Cc: Vlastimil Babka <vbabka@...e.cz>
> Cc: Yang Shi <shy828301@...il.com>
> Cc: Yin Fengwei <fengwei.yin@...el.com>
> Cc: Yu Zhao <yuzhao@...gle.com>
> Cc: Zi Yan <ziy@...dia.com>
> Signed-off-by: Barry Song <v-songbaohua@...o.com>

Reviewed-by: Ryan Roberts <ryan.roberts@....com>

> ---
>  mm/memory.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index c9c1031c2ecb..010e7bb20d2b 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -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) {


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ