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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <HK0PR03MB41775573A48273BF128C7F72D5FA9@HK0PR03MB4177.apcprd03.prod.outlook.com>
Date:   Fri, 13 Aug 2021 08:27:25 +0000
From:   Jichao Zou <zoujc@...orola.com>
To:     David Hildenbrand <david@...hat.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "minchan@...nel.org" <minchan@...nel.org>,
        "song.bao.hua@...ilicon.com" <song.bao.hua@...ilicon.com>,
        "hch@....de" <hch@....de>,
        "m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
        JianQi Yang <yangj@...orola.com>,
        Yanjune Tian <tianyje@...orola.com>
Subject: 回复: [External]Re: An cma optimization patch is used for cma_[alloc|free].

Hi David,
	I'll git-send-email patch again.
	Your understanding is exactly right. 
	Let me explain the background of Patch, we are developing Android phone, kernel is 5.10.43 LTS, we encounter cma_alloc failed during kernel startup, buddy system is ready,  
01-11 14:22:08.650   216   216 E cma     : cma_alloc([216][init]:cma(ffffffff00b50000:total 8192) linux,cma(ffffffe89d084cf0), count 2, align 1 gfp_mask 0xcc0)
01-11 14:22:08.650   216   216 E cma     : cma_alloc(): memory range at ffffffff00b62880 is busy, retrying
 
	cma bitmap show memory is free, but alloc_contig_range failed, we checked it out that some drivers cma_alloc are 
	"struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, bool no_warn)"
	In 5.10.43, cma_alloc is  
	"struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, gfp_t gfp_mask)"
 	After change cma_alloc parameter with GFP_KERNEL, issue is fixed, at the same time, we found that preallocate a portion of cma memory for audio&video resulted in better performance and guarantee AV function even under memory pressure, so we try to submit this patch.

Thanks.

Best Regards,

Zou Jichao 邹纪超
Advisory Engineer, SW BSP
MBG ROW SW BJ PF BSP (CN)
Motorola Mobility, A Lenovo Company
motorola.com 
M +86 18910860212
E zoujc@...ovo.com
twitter | facebook | instagram | blog | forums 




-----邮件原件-----
发件人: David Hildenbrand <david@...hat.com> 
发送时间: 2021年8月13日 15:45
收件人: Jichao Zou <zoujc@...orola.com>; akpm@...ux-foundation.org; linux-kernel@...r.kernel.org; linux-mm@...ck.org; minchan@...nel.org; song.bao.hua@...ilicon.com; hch@....de; m.szyprowski@...sung.com; robin.murphy@....com; iommu@...ts.linux-foundation.org; JianQi Yang <yangj@...orola.com>; Yanjune Tian <tianyje@...orola.com>
主题: [External]Re: An cma optimization patch is used for cma_[alloc|free].

On 13.08.21 09:00, Jichao Zou wrote:
> Pre-allocate CMA memory that configured in device tree, this greatly 
> improves the CMA memory allocation efficiency, cma_[alloc|free] is 
> less than 1ms, old way is took a few ms to tens or hundreds ms.
> 

Please send patches as proper emails (man git-format-patch; man git-send-email).

What you propose is turning cma reservations into something comparable to permanent boottime allocations. From the POV of the buddy, the pages are always allocated and cannot be repurposed for e.g., movable allocations until *actually* allocated via CMA.

I don't think we want this behavior upstream.

--
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ